3 ms·
eval is not a good idea if you want to write a compiler that generates small efficient binaries either. This is why, for example the Stalin Scheme compiler does
by anaphor 12y ago
eval is not a good idea if you want to write a compiler that generates small efficient binaries either. This is why, for example the Stalin Scheme compiler does not include eval.
"Running that image has equivalent semantics to loading the Scheme source file into a virgin Scheme interpreter and then terminating its execution. The chief limitation is that it is not possible to LOAD or EVAL new expressions or procedure definitions into a running program after compilation. In return for this limitation, Stalin does substantial global compile-time analysis of the source program under this closed-world assumption and produces executable images that are small, stand-alone, and fast."
https://github.com/barak/stalin https://github.com/barak/stalin
- abecedarius 12y agoThat's worth bringing up, but it's not eval that causes a problem, it's access to environments, especially mutable access. You can implement eval as an interpreter in your own Scheme program, so supplying it as primitive can have no extra consequences; conversely if you have first-class environments, passing (the-environment) to some opaque procedure would do all the damage to analyzability already.