Ruby 1.9
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
๐๏ธ 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).
๐ 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.
๐ ๏ธ 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.
๐ 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.
๐ 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.
๐ 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.
๐ 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.
๐ 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.
๐ฎ 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
๐กRuby
๐กYARV
๐กVersioning
๐กIncompatibility
๐กEnumerator
๐กUnicode
๐กScalability
๐กJRuby
๐กCommunity
๐กContinuations
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
5.0 / 5 (0 votes)
Thanks for rating: