Hacker News new | past | comments | ask | show | jobs | submit login

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

It is certainly possible to implement this sort of thing in other languages, I think, depending on the compilation or preprocessing setup






Possible doesnt mean "requires same ammount of effort"

That'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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: