Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Alexander Ivanov @alehander42, Zahary Karadjov @zah Generating code and compiling code are very useful, but usually the target is the machine: so the generated code is very unfriendly for programmers. We will show two approaches with which we are able to compile Ruby to code in statically typed languages and make it idiomatic and nice pseudocode-like(where we support small programs in a subset of Ruby, but we can generate correct statically typed code in C++, C#, Go, Java) and realcode-like, where we infer ruby types on runtime and autotranslate more complicated codebase to Nim(rb2nim): the result requires some manual work, but automates most of it. RubyKaigi 2019 https://rubykaigi.org/2019/presentations/alehander42.html#apr18
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 presentation titled "Compiling Ruby to idiomatic code in static languages" at RubyKaigi 2019, speakers Alexander Ivanov and Zahary Karadjov delve into translating dynamic languages, particularly Ruby, into statically typed languages like C++, C#, Go, and Java. They explore two main approaches: - **Pseudocode-like Translation**: This approach supports a subset of Ruby, focusing on generating straightforward statically typed code in various target languages. The speakers emphasize the need for idiomatic code that developers can easily understand, reinforcing the idea that automated translation should not compromise code quality. - **Realcode-like Translation with Ruby Tuning**: This method involves inferring Ruby types at runtime and translating complex codebases to Nim using a project called rb2nim. The speakers explain that while this process does necessitate some manual adjustments, it automates a significant portion of the work. The duo explains the rationale behind translating from Ruby, indicating that as projects grow in complexity and user base, businesses may seek to rewrite their systems in more efficient languages. This transition is often costly and fraught with risks, prompting the search for safer alternatives. They cite the need for optimized algorithms and leverage Ruby during rapid prototyping phases to maintain code efficiency in finalized products. Key project developments highlighted include: - **Pseudocode Project**: Originally designed to generate algorithms across multiple languages based on a common logic. - **PI to Nim Project**: Focuses on translating Python code into Nim, successfully translating around fifty thousand lines of code while adapting to changes in the codebase over time. - **Ruby Tuning Tool**: Aimed at tracing Ruby execution to annotate and infer function types, allowing for better automatic translation into Nim, while maintaining the dynamics of Ruby’s meta-programming features. The presentation also emphasizes the importance of testing in Ruby for successful type inference and translation accuracy. The speakers conclude by discussing their goals for language translation projects, the need for community feedback, and their openness to suggestions for future translations, ensuring their work continues to address developers’ requirements effectively. In summary, Ivanov and Karadjov aim to enhance translation capabilities to preserve the idiomatic beauty and functionality of Ruby while increasing the reach of Ruby code into other static languages.
Suggest modifications
Cancel