Re:Designing a Language Without a Parser
by medo-bear on Wednesday July 05, 2023 @05:22AM
(#36597846)
Plenty of languages give you the option of writing macros, however the difference between writing macros in a lisp and those languages is like the difference between using a general purpose programming language and an accidentally Turing-complete one.
C's preprocessor is such an 'accident'. But eg Rust's macros and template Haskell are very deliberately designed.
Re:Designing a Language Without a Parser
by medo-bear on Wednesday July 05, 2023 @05:57AM
(#36598126)
No. You can say that Common Lisp and Racket are deliberately designed around macros. In Haskell, Rust, C++, they have been bolted on to the language as an after thought. Unless I am mistaken, those languages do not have the ability to write DSLs interactively, unlike Common Lisp.
What do you mean by 'write DSLs interactively'?
That's not how Lisp works. Lisp macros don't operate on an AST.
I don't know how they work, how do they work?
https://doc.rust-lang.org/reference/procedural-macros.html