News for hackers. Stuff that matters.
Re:A Little Clojure by hope-striker on Wednesday April 08, 2020 @05:11AM (#22811279)
> These let you build all sorts of language constructs that you couldn't build in other programming languages.

Many languages (e.g. Rust[0]) let you write procedural macros, even if their grammar is much more complex than that of a Lisp.

Is there some technical advantage to Lisp macros over macro processors in other languages (ignoring string-based ones like the CPP), or do all the benefits lie in the massively improved ergonomics of writing macros?

(Note that Rust also has simpler hygienic macros, but they're not expressive enough for many things.)

[0]: https://doc.rust-lang.org/reference/procedural-macros.html

Re:A Little Clojure by roenxi on Wednesday April 08, 2020 @06:24AM (#22811645)
You've pretty much covered it; lisps are better at macros than any language with complicated syntax.

Most of the flow control in a lisp (for, while, if, etc, etc) can be implemented with macros. It isn't often a program needs a new form of flow control but when you need it it is there as an option and a lisp will do it better than the competition. If Rust can do threading macros then it probably has enough of the power that it isn't missing out. Still going to be a bit cumbersome.

Lisps give you the option that flow control can be implemented in a library. None of the old-school popular languages manage that.