Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Transpiling is a source-to-source compiling. Why might we need it in Ruby? Compatibility and experiments. Ruby is evolving fast nowadays. The latest MRI release introduced, for example, the pattern matching syntax. Unfortunately, not everyone is ready to use it yet: gems authors have to support older versions, Ruby implementations are lagging. And it's still experimental, which raises the question: how to evaluate proposals? By backporting them to older Rubies! I want to discuss these problems and share the story of the Ruby transpiler — Ruby Next. A decent amount of Ruby hackery is guaranteed.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the RubyKaigi 2020 Takeout edition talk, Vladimir Dementyev discusses the concept of transpiling in Ruby and introduces a transpiler project called Ruby Next. Transpiling allows developers to utilize modern Ruby syntax features on older Ruby versions, which addresses compatibility issues with both gem authors and alternative Ruby implementations. **Key Points Discussed:** - **Definition of Transpiler:** A transpiler is a source-to-source compiler that converts code from one version of a language to another, enabling the use of newer features in older environments. - **Current State of Ruby:** The talk highlights the evolution of Ruby, particularly focusing on features introduced in Ruby 2.8 and upcoming changes in Ruby 3.x, such as pattern matching and rightward assignment. - **Need for Transpiling in Ruby:** Many developers still use older Ruby versions and are unable to access newer syntax features due to compatibility constraints. A notable example is the lack of support for pattern matching in Ruby 2.5. - **Introducing Ruby Next:** Ruby Next is a transpiler that allows developers to write modern Ruby code while maintaining support for older versions, enhancing usability and experimentation with new features. - **Transpilation Process:** The process involves parsing the source code, generating an Abstract Syntax Tree (AST), and applying rewriters for preferred features like pattern matching. The talk illustrates how transpiling can help reframe existing code into a more complex yet functional format for older Ruby versions while retaining original programming paradigms. - **Performance and Optimization:** The transpiler can yield faster execution times in some cases, demonstrating its potential as a tool not just for improved development but for influencing Ruby's future enhancements. - **Community Engagement through Experimentation:** By allowing the community to experiment with experimental features using Ruby Next, real-world feedback can help decide which features should be retained or discarded before they reach stability. In conclusion, transpiling in Ruby via Ruby Next is presented as a solution for developers facing compatibility issues while fostering community involvement and evolving Ruby effectively through feedback and experimentation.
Suggest modifications
Cancel