4 ms·
But Rust macros also do this, the procedural macros operate on the AST of the macro https://doc.rust-lang.org/reference/procedural-macros.html https://doc.rust
by iopq 3y ago
But Rust macros also do this, the procedural macros operate on the AST of the macro
https://doc.rust-lang.org/reference/procedural-macros.html https://doc.rust-lang.org/reference/procedural-macros.html
- medo-bear 3y agoPlenty 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.
- eru 3y agoC's preprocessor is such an 'accident'. But eg Rust's macros and template Haskell are very deliberately designed.
- medo-bear 3y agoNo. 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.
- eru 3y agoWhat do you mean by 'write DSLs interactively'?
- lispm 3y agoThat's not how Lisp works. Lisp macros don't operate on an AST.