Lisp Macros

Discussions center on the power, ease of use, and unique features of macros in Lisp family languages like Common Lisp and Clojure, compared to macros in other languages such as Rust, Elixir, Haskell, and Scheme, often emphasizing homoiconicity and code-as-data.

📉 Falling 0.4x Programming Languages
5,127
Comments
20
Years Active
5
Top Authors
#7731
Topic ID

Activity Over Time

2007
34
2008
107
2009
167
2010
188
2011
250
2012
211
2013
234
2014
359
2015
334
2016
401
2017
379
2018
344
2019
387
2020
310
2021
294
2022
329
2023
254
2024
330
2025
210
2026
5

Keywords

e.g XML DSL LISP BTW github.com CL JSX ycombinator.com GNU macros lisp macro language languages function code common lisp powerful cl

Sample Comments

anothername12 • Jan 29, 2025 • View on HN

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

finnw • Oct 31, 2012 • View on HN

"has X so you don't need macros" is not equivalent to "has macros" (otherwise nearly every language could claim to be "a lisp.")

alehander42 • May 19, 2020 • View on HN

these days many newer languages have macros: lisp is not alone

jpochtar • Apr 4, 2019 • View on HN

I hear LISP has a pretty good macro system...

auganov • Jul 18, 2016 • View on HN

tldr it's not about macros it's about homoiconicity;

jiyinyiyong • May 26, 2020 • View on HN

Try Elixir, it supports macros. Also Rust has Macros too. Although Lisp macros is different and may be more old fashion in some aspects, but it won't be hard to get the idea of code generating language, just pick one and try it.

sesquipedalian • Jul 1, 2015 • View on HN

What makes Common Lisp macros easier to use than Scheme's?

such_a_casual • Jun 9, 2017 • View on HN

It's pretty trivial to add macros to any language. The only thing that separates a macro from a regular function is time. In a normal function, the parameters are evaluated before being sent to the function. In a macro, the function is called before the parameters are evaluated. What separates lisp from other languages when it comes to macros is that the language is very simple and provides lots of tools for operating on the same data structure that you write your code in.Of course you c

ntoshev • Mar 14, 2009 • View on HN

Can you give an example of something you can implement with a Lisp macro, but you can't implement with Haskell?

LandR • Oct 23, 2021 • View on HN

Any lisp will give you macros like you describe. If say lisp macros are more powerful and simpler too.