Ruby 1.9

Google TechTalks
22 Feb 200849:57
EducationalLearning
32 Likes 10 Comments

TLDRIn this talk, Yukihiro 'Matz' Matsumoto, the creator of Ruby, discusses the evolution of the Ruby language, focusing on Ruby 1.9's new features, performance improvements with YARV, and the challenges of maintaining backward compatibility. He also touches on the future of Ruby, including plans for version 2.0 and the importance of community and innovation.

Takeaways
  • ๐Ÿ‘‹ Introduction: Matz, the creator of Ruby, gave a public talk that was recorded for YouTube, emphasizing that there would be no confidential information discussed.
  • ๐Ÿ“… Ruby's History: Matz designed Ruby in 1993, and it has evolved with different versions catering to various needs, such as the stable 1.8 version and the more experimental 1.9.
  • ๐Ÿ” Versioning Strategy: Ruby uses a three-version strategy with 1.8 being stable, 1.9 being cutting-edge, and 2.0 focusing on scalability, although the specifics of 2.0 were still vague at the time of the talk.
  • ๐Ÿš€ Performance Improvement: Ruby 1.9 introduced YARV, a new virtual machine that significantly improved the language's performance, making it faster than previous versions.
  • ๐ŸŒ Unicode Support: Ruby 1.9 enhanced multilingual support with better Unicode handling, moving away from byte-based strings to character-based strings.
  • ๐Ÿ”ง Incompatibility Changes: With the update to 1.9, some incompatibilities were introduced, such as changes to block parameters and the removal of strings as enumerable objects.
  • ๐Ÿ› ๏ธ New Features: Ruby 1.9 introduced several new features, including a new syntax for lambdas, method invocation, and enumerators, aiming to improve the language's functionality.
  • ๐ŸŒŸ Community Highlight: Matz expressed pride in the Ruby community, which is known for being friendly and productive, contributing to the language's success.
  • ๐ŸŒˆ Multiple Implementations: Ruby has multiple implementations, including MRI, YARV, JRuby, and IronRuby, showcasing the language's versatility across different platforms.
  • ๐ŸŽฏ Future of Ruby: Matz is committed to the ongoing development of Ruby, focusing on improving 1.9 and looking forward to the innovations that 2.0 will bring.
  • โ“ Call/cc Continuation: The talk touched on the absence of Call/cc in 1.9, noting that it can still be used by requiring the continuation library, acknowledging its complexity and potential risks.
Q & A
  • Who is the speaker at the beginning of the transcript?

    -The speaker at the beginning of the transcript is Matz, also known as Yukihiro Matsumoto, the creator of the Ruby programming language.

  • What is the significance of Ruby 1.9 in the context of this talk?

    -Ruby 1.9 is significant as it was the 'Bleeding Edge Version' at the time of the talk, featuring improvements in speed and power, and addressing some design mistakes from previous versions.

  • What is the primary motivation for Ruby 2.0 according to Matz?

    -The primary motivation for Ruby 2.0, as mentioned by Matz, is scalability in data size, program size, and team size, although he admits that his ideas on scalability were still vague at the time of the talk.

  • Why did Matz decide to make block parameters local variables only in Ruby 1.9?

    -Matz decided to make block parameters local variables only in Ruby 1.9 to align with the functional trend, as blocks were increasingly being used like anonymous functions rather than loop constructs.

  • Why did Matz choose to stop treating strings as enumerable in Ruby 1.9?

    -Matz stopped treating strings as enumerable in Ruby 1.9 to eliminate ambiguity, as there was no single 'right' way to view strings as they could be seen as a sequence of lines, characters, or bytes.

  • What is the role of YARV in Ruby 1.9?

    -YARV, or Yet Another Ruby VM, is a new virtual machine integrated into the core of Ruby 1.9, which significantly improved the performance of the Ruby interpreter.

  • What does Matz mean by 'innovation bait' in the context of Ruby's development?

    -By 'innovation bait,' Matz refers to the need for interesting new features to keep the community engaged and moving forward. Without such bait, there would be no innovation, and the language might eventually die.

  • How does Matz address the issue of incompatibility between Ruby 1.8 and 1.9?

    -Matz acknowledges the incompatibility issues and provides examples of changes, such as block parameters and strings handling. He also mentions that most of the incompatibilities are trivial and that serious developers should be using the stable 1.8 version for daily use.

  • What is the status of Call/cc in Ruby 1.9 according to the transcript?

    -Call/cc is not included by default in Ruby 1.9 due to its potential for misuse. It can be used by explicitly requiring the continuation library, indicating a conscious decision to engage in 'dangerous' programming practices.

  • What is Matz's perspective on the Ruby community?

    -Matz is proud of the Ruby community, describing it as dynamic, flexible, and productive. He also mentions that it is considered one of the best communities in the open source ecosystem.

  • What is the reason behind releasing major Ruby versions around Christmas according to Matz?

    -Matz releases major Ruby versions around Christmas for personal reasons, such as having a holiday after the release, and as a modest way to acknowledge Christianity in a non-Christian country.

Outlines
00:00
๐ŸŽ™๏ธ Introduction to Matz and Ruby Language

The speaker, Matz, the creator of Ruby, is introduced at a public talk that will be recorded and shared on YouTube. The audience includes local user groups and external participants. Matz mentions that Google developers are not allowed to use Ruby but expresses interest in their work. He plans to discuss Ruby 1.9, its features, and the language's versioning strategy, which includes a stable version (1.8), a bleeding edge version (1.9), and an innovation bait version (2.0/2.1).

05:09
๐Ÿ” Incompatibilities and New Features in Ruby 1.9

Matz details the incompatibilities introduced in Ruby 1.9, such as changes to block parameters, strings no longer being enumerable, and the handling of Unicode with M17N. He explains the rationale behind these changes, emphasizing the shift towards local variable scope in blocks and the abandonment of strings as enumerable sequences. Matz also highlights new features in Ruby 1.9, including the integration of Unicode support and the introduction of enumerators for more explicit control over iteration.

10:13
๐Ÿ› ๏ธ Ruby 1.9 Enhancements and YARV

Matz discusses the enhancements in Ruby 1.9, including the introduction of a new virtual machine called YARV, which stands for Yet Another Ruby VM. YARV is a bytecode interpreter optimized for Ruby, developed by Koichi Sasada. It has significantly improved the performance of Ruby, with core performance improvements ranging from 2 to 50 times faster, depending on the benchmark. However, Matz notes that while the core interpreter is faster, overall program performance improvements are less dramatic due to unchanged libraries and garbage collection.

15:22
๐ŸŒ The Philosophy and Community of Ruby

Matz reflects on the essence of Ruby, which he describes as a combination of the language itself, its community, and various implementations. He expresses pride in the Ruby community, which is known for being friendly and productive. Matz also acknowledges the existence of multiple Ruby implementations, such as MRI, YARV, JRuby, and IronRuby, which have emerged over the years, enhancing the language's versatility and performance across different platforms.

20:28
๐Ÿ“… Ruby Release Timing and Future Plans

Matz addresses the timing of Ruby's major releases, often coinciding with Christmas, explaining it as a personal choice to have a break after intense work. He also discusses the future of Ruby, including the ongoing work on Ruby 1.9 and the anticipation of Ruby 2.0. Matz hints at the themes of scalability and innovation that will drive the development of Ruby 2.0.

25:29
๐Ÿ”„ Questions and Answers on Ruby's Evolution

The session concludes with a Q&A, where Matz answers questions about the compatibility of features between Ruby versions, the reasons behind the choice of release dates, and the process of establishing an official Ruby specification through collaboration with the JRuby and Ruby Nous communities. He also touches on the topic of Call/cc, a feature not included in Ruby 1.9 due to its complexity and potential for misuse.

30:38
๐Ÿ”‘ Ruby's String Representation and Efficiency

Matz explains Ruby's internal string representation, emphasizing the use of raw byte sequences to avoid encoding conversion issues. He discusses the challenges and efficiency considerations of accessing characters by numeric index in UTF-8 encoded strings, acknowledging potential inefficiencies in certain operations like string reversal but suggesting that Ruby's approach provides a balance that works well in most cases.

35:45
๐Ÿ“ Discussion on Ruby 2.0's Named Parameters

During the Q&A, Matz is asked about the implementation of named parameters in Ruby 2.0. He confirms that named parameters will be introduced but clarifies that they will be simpler compared to Python's implementation. Matz describes the syntax for named parameters and how they will be distinguished from hash arguments in the function call syntax.

40:54
๐Ÿ”ฎ Final Thoughts and Closing Remarks

In the final part of the Q&A, Matz addresses the uncertainty around the exact syntax for Ruby 2.0's features, suggesting that the community will have to wait and see. He wraps up the session with a reminder of the joy and satisfaction that the Ruby language aims to bring to programmers around the world.

Mindmap
Keywords
๐Ÿ’กMatz
Matz, or Yukihiro Matsumoto, is the designer and original developer of the Ruby programming language. He is a central figure in the Ruby community and the script revolves around his presentation and insights into the evolution of Ruby. In the script, Matz discusses various aspects of Ruby, including its design, features, and future development plans.
๐Ÿ’กRuby
Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Matz. The script primarily discusses the Ruby language, its versions, and its evolution, with Matz highlighting the features and improvements in Ruby 1.9.
๐Ÿ’กYARV
YARV stands for Yet Another Ruby VM and refers to the virtual machine used to execute Ruby code. In the script, Matz explains that YARV was integrated into Ruby 1.9, which significantly improved the language's performance by optimizing the bytecode interpreter for Ruby.
๐Ÿ’กVersioning
Versioning in the context of the script refers to the strategy Matz uses for Ruby's different versions. Matz describes three types of versions: Stable (1.8), Bleeding Edge (1.9), and Innovation Bait (2.0/2.1). This concept is crucial for understanding the development stages and the intended use for each version of Ruby.
๐Ÿ’กIncompatibility
Incompatibility in the script refers to the changes in Ruby 1.9 that are not backward compatible with Ruby 1.8. Matz discusses several significant incompatibilities, such as changes to block parameters and strings, which are essential for developers to understand when migrating to newer versions of Ruby.
๐Ÿ’กEnumerator
An Enumerator in Ruby is an object that enables external iteration over a collection of objects. In the script, Matz mentions that Enumerators were made built-in as of Ruby 1.9, allowing for method chaining and more flexible iteration, which is a new feature that enhances the language's capabilities.
๐Ÿ’กUnicode
Unicode is a computing industry standard for consistent encoding, representation, and handling of text expressed in most of the world's writing systems. Matz discusses Ruby's support for Unicode and multilingualization (M17N), emphasizing the improvements in handling character encodings in Ruby 1.9.
๐Ÿ’กScalability
Scalability in the script refers to Matz's vision for Ruby 2.0, focusing on the language's ability to handle larger data sizes, program sizes, and team sizes. Scalability is a key aspect of the future development of Ruby, aiming to make it more robust and adaptable for larger projects.
๐Ÿ’กJRuby
JRuby is an implementation of the Ruby language that runs on the Java Virtual Machine (JVM). In the script, Matz mentions JRuby as an alternative Ruby implementation that provides compatibility with Java libraries and can be used to run Ruby on Rails applications on the JVM.
๐Ÿ’กCommunity
The Ruby community is a group of developers and enthusiasts who contribute to and support the Ruby language. Matz expresses pride in the Ruby community, noting its reputation for being friendly and supportive, which is an essential aspect of the language's ecosystem.
๐Ÿ’กContinuations
Continuations in Ruby are a feature that allows you to capture the execution state of a program and then 'continue' from that state later. Matz mentions that Call/cc (call with current continuation) is considered dangerous and is available in Ruby 1.9 but requires explicit inclusion of a continuation library.
Highlights

Matz designed and created the Ruby language.

Ruby 1.9 was released on Christmas 2007.

Ruby versioning strategy includes three versions: Stable, Bleeding Edge, and Innovation Bait.

Ruby 1.8 is the Stable Version, suitable for daily use by serious developers.

Ruby 1.9 is the Bleeding Edge Version, faster and more powerful than 1.8.

In Ruby 1.9, block parameters are local variables only, a significant change from 1.8.

Strings in Ruby 1.9 are no longer enumerable, requiring explicit specification for line or character iteration.

Ruby 1.9 introduces full Unicode support with character encoding awareness.

The new virtual machine YARV is integrated into Ruby 1.9, improving performance.

YARV can run Ruby code up to 50 times faster in core performance.

Ruby 1.9 includes new features like Lambda syntax and method invocation with .().

Enumerators are now built-in in Ruby 1.9, allowing for chains of enumerators.

Ruby's community is noted for being dynamic, flexible, and productive.

Multiple implementations of Ruby exist, including MRI, YARV, JRuby, and IronRuby.

JRuby allows Ruby on Rails to run on the JVM, with access to Java libraries.

Ruby 2.0 will focus on scalability in data size, program size, and team size.

Ruby 2.0 will introduce named parameters, similar to Python's syntax.

Ruby's string data type uses raw byte sequences internally, avoiding encoding conversion issues.

Transcripts
Rate This

5.0 / 5 (0 votes)

Thanks for rating: