News for hackers. Stuff that matters.
Re:The Programming Language Conundrum by nwmcsween on Saturday March 30, 2019 @05:15PM (#19531910)
Metaprogramming is amazing though and in languages that allow it like Ruby make amazing DSLs.
Re:The Programming Language Conundrum by vinceguidry on Sunday March 31, 2019 @05:15AM (#19534613)
The beauty of Ruby is that you only need one metaprogramming call to make a DSL in Ruby. Define all your custom methods in a DSL class, then use instance_exec to run the code using the DSL in the context of an instance of that class. The instance can use instance variables to keep track of any state that the DSL requires. Super-elegant.