Live data from Hacker News

An update on Dart macros and data serialization

medium.com

11–20 of 125 posts

Re: An update on Dart macros and data serialization

#14

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

This is just my opinion but I believe it's because the syntax tree is the syntax. In a Lisp macro you are working with lists, just like you are for any other Lisp code. Almost every other language I've used (I've been programming since the late 1980s) has, at best, a special data structure to manipulate ASTs. So it ends up being quite unnatural. Lisp macros are just Lisp.

Re: An update on Dart macros and data serialization

#16
post #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.

It’s possible to do that, but in practice it’s quite uncommon. Especially since Lisps offer great tools for programmers to learn what the macros that the are using actually do.

Re: An update on Dart macros and data serialization

#17
They should have just use C# for Flutter.

Without investing significant time, like they did with Dart, they would have a language with a much bigger ecosystem that is faster, already has compile time code generation and better support for data than Dart. It supports ahead-of-time compilation and hot-reload. The only feature missing in C# is compilation to JS, but with WASM is that really needed? Biggest downside of C# is probably that it's not invented at Google.

Re: An update on Dart macros and data serialization

#18
post #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.

> in Scheme you can redefine `define` to be number 5.

This is like asking "what if your coworker named all errs as `ok`" so everything was `if ok { return errors.New("Not ok!!"); }`. It's possible but no one does it.

This is why `defmacro` and `gensym` in common lisp are awesome, and similarly why Go's warts don't matter. Much of programming language ugliness is an "impact x frequency" calculation, rather than one or the other.

It's also why javascript is so terrible, you run into it's warts constantly all day long.

Re: An update on Dart macros and data serialization

#19
FWIW, I enjoyed the hundreds of hours I spent with dart:mirrors to automate serialization, and the code-generation heavy approach always felt like kind of a bummer. But I feel like AI-assisted programming solves the majority of use cases this feature was meant for.
Post reply on HN