Re:Why Lisp macros are cool, a Perl perspective (2005)
by lispm on Monday December 16, 2019 @09:17PM
(#21809847)
I can compile a file to machine code and load it into another process. The file compiler provides the 'compile-time'. The other process then provides 'load-time' and 'run-time'.
Re:Why Lisp macros are cool, a Perl perspective (2005)
by ScottBurson on Monday December 16, 2019 @11:01PM
(#21810406)
Right, you can also do it that way. I should have said "all these things can happen in a single process in an interleaved manner".
Re:Why Lisp macros are cool, a Perl perspective (2005)
by ScottBurson on Tuesday December 17, 2019 @04:02AM
(#21811905)
If anyone's still reading, I can't resist adding that I was doing type checking by macro expansion — a technique that was the subject of a 2017 POPL paper [0] — in 1983.
[0] https://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf
It is certainly true that macros are a different kind of code from most ordinary code, because what they're doing is different. But importantly, they are written in the same Turing-complete language. I once wrote a program (a C implementation for Lisp Machines) that allowed the user to interactively execute C expressions. Obviously, it had to parse the C code according to the syntax of that language, but the parser produced list structure that consisted entirely of macro calls. The guts of the compiler were implemented as a collection of macros that translated the output of the parser into Lisp Machine Lisp. These macros did things like accessing and updating a symbol table — far beyond what you could do in a C macro.