Why did FEXPR abandon Common Lisp?

Many LISPs had FEXPR, but they were not included in the CL.
I read that this is due to the fact that FEXRP do not work well with static analysis.
Can someone explain this?

+7
source share
3 answers

From the Wikipedia article on FEXPRs :

At the 1980 Lisp and Functional Programming Conference, Kent Pitman presented the paper, โ€œSpecial Forms in Lisp,โ€ in which he discussed the advantages and disadvantages of macros and fexprs, and ultimately convicted fexprs. His central objection was that, in the Lisp dialect, what fexprs allows, static analysis cannot determine at all whether the operator represents a regular function or fexpr - therefore, static analysis cannot determine whether operands will be evaluated. In particular, the compiler cannot determine whether the subexpression can be safely optimized, since the subexpression can be treated as unsatisfied data at runtime.

+3
source

Kent Pitman called to abandon fexpr because it could not be compiled.

For an in-depth discussion of fexpr, see John N. Shatt's dissertation Fexprs as the foundation of a Lisp function application or $ vau: finite abstraction .

+3
source

FEXPR more like DEFUN than DEFMACRO as they become first class objects. This seems difficult for the compiler because it cannot know whether something is a function or a macro at compile time, leaving perhaps some macros that were not extended at compile time. You can read the article here with comments .

After reading it, Iโ€™m not sure that its conclusions are still correct, as our compilers perform better advanced permanent folding and other optimizations. In any case, macros of a higher order are not as useful as functions of a higher order, so we wonโ€™t miss them very much.

Paul Grahams Arc has anonymous macros and they also have them so it didn't completely go away, but I feel that it was just for convenience. Try map , and you will see how useful this is.

+1
source

Source: https://habr.com/ru/post/952071/


All Articles