3 ms·
I'm thoroughly convinced that fexprs are a bad idea and so, good riddance. Our Lisp hacking predecessors did us a huge favor by figuring this out and documentin
by kazinator 4y ago
I'm thoroughly convinced that fexprs are a bad idea and so, good riddance. Our Lisp hacking predecessors did us a huge favor by figuring this out and documenting it.
Fexprs are hostile toward compiling. Specifically, True Scotsman's ahead-of-time compiling where we take an entire file or set of files and turn them into compiled equivalents, whereby we obtain:
1. Useful diagnostics without running the code.
2. Deliverables which load and execute faster, and don't require any code processing at run time (unless we choose that as part of application logic).
3. Resistance to reverse engineering, so we get paid. :)
Even a macro expander in front of an interpreter can provide error checking, such as finding unbound variables, reporting about misused special forms, and even things like functions being called with wrong numbers of arguments.
Macros themselves can be well written and provide decent error checking. So could fexprs, but fexprs have to be called.
You can't code walk fexprs because you don't know which parts of the argument material of a fexpr contains more fexprs.
It is counterproductive to lose the ability to completely code-walk a program, just to gain the ability to perpetrate trompe d'oeil metaprogramming: the software engineering equivalent of having a hand reach out of the picture, holding a pencil which draws the picture frame.