Live data from Hacker News

An update on Dart macros and data serialization

medium.com

1–10 of 125 posts

Re: An update on Dart macros and data serialization

#5
Maybe it's time to just recognize that lisp-style macros-as-language-syntax features just aren't worth the struggle and grief?

The big metaprogramming feature traditionally implemented in macros, type generation, is already provided in some form by all major languages already.

And an awful lot (and I mean an awful lot) of good work can be done at the string replacement level with cpp. And generating code upstream of the compiler entirely via e.g. python scripts or templating engines is a very reasonable alternative too. And at lower levels generating code programmatically via LLVM and GPU shaders is well-trodden and mature.

Basically, do "macros" really have a home as a first class language feature anymore?

Re: An update on Dart macros and data serialization

#7

Why is it that Lisp family macros are easy to implement and use, but not so in other languages?

Are Lisp macros easy to use? My understanding was that Lisp code is notoriously difficult to understand if you didn't write it, largely because of the obscenely powerful macro system that makes it too easy to be too clever. Which is essentially the same complaint that everyone has about every macro system.

Re: An update on Dart macros and data serialization

#9

Why is it that Lisp family macros are easy to implement and use, but not so in other languages?

in Scheme you can redefine `define` to be number 5. Easy to implement, but a nightmare in real world scenarios [0]. That's why languages like Go became popular, they're trashy, boring, and dumb, but that's exactly what's needed in big projects.

[0]: imagine your colleague wrote a macro that redefines for loops because at the time, it made life easier for him.

Re: An update on Dart macros and data serialization

#10
post #5

Maybe it's time to just recognize that lisp-style macros-as-language-syntax features just aren't worth the struggle and grief? The big metaprogramming feature traditionally implemented in macros, type generation, is already provided in some form by all major languages already. And an awful lot (and I mean an awful lot) of good work can be done at the string replacement level with cpp. And generating code upstream of…

In another world, macros could have filled the role that programmable yaml fills today.
Post reply on HN