Code Generation
Use Macro all the time ~ マクロを使いまくろ ~

Use Macro all the time ~ マクロを使いまくろ ~
osyo • September 09, 2021 • online

Ruby can get AST with RubyVM::AbstractSyntaxTree. I have implemented to convert AST into Ruby code. This will allow you to modify and execute Ruby code at AST level.

Ruby code → Convert to AST → Convert to another AST → Convert AST to Ruby code → Run Ruby code

In this session, I will discuss "Implementations for converting AST to Ruby code" and "Implementations for converting AST to another AST". This feature of "converting to another AST" is similar to what is called a "Macro" in other languages. Let's think together about what happens when we implement "Macro" in Ruby.

RubyKaigi Takeout 2021: https://rubykaigi.org/2021-takeout/presentations/pink_bangbi.html

RubyKaigi 2021 Takeout

Explore all talks recorded at RubyKaigi 2021 Takeout
+32