logoalt Hacker News

throw-qqqqqtoday at 11:28 AM1 replyview on HN

Generally, it enables type-safe, ahead-of-time compiled code to perform work at compile time that would require runtime execution in many other languages


Replies

dreamcompilertoday at 11:51 AM

That's true but it's not the most important aspect of macros. Macros let you define a new language that describes your problem solution more directly than you can in raw Lisp. In other words they let you create a Domain-Specific Lamguage (DSL). You can create DSLs in other languages too but it's so difficult that it's uncommon. In Lisp it's so easy that DSLs are a primary programming technique.

show 2 replies