Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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



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.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: