4 ms·
I don't know how many other languages use it but I've long admired Elixir's approach to giving devs access to the AST using its basic types in order to write ma
by pmarreck 2y ago
I don't know how many other languages use it but I've long admired Elixir's approach to giving devs access to the AST using its basic types in order to write macros:
https://hexdocs.pm/elixir/macros.html https://hexdocs.pm/elixir/macros.html
It is certainly possible to implement this sort of thing in other languages, I think, depending on the compilation or preprocessing setup
- medo-bear 2y agoPossible doesnt mean "requires same ammount of effort"
- pmarreck 2y agoThat's fair. I think it's a big win, though. Macros, when the situation calls for it, are amazing. For example, I believe most of the UTF8 handling code in Elixir was done via macros which brought down the amount of code that had to be maintained by quite a bit.