|
|
|
|
|
by greghendershott
3888 days ago
|
|
Exactly. There's a spectrum of evaluation strategies from eager to lazy. Programs may mix various flavors. Lazy evaluation combined with memoization is a sexy and elegant approach to some problems, as are dynamic web sites. On the other hand, whenever possible to do so, it's hard to beat the speed and simplicity of handing over a precomputed answer like "42". A (very loose) analogy: Static generation of HTML is roughly like using Lisp macros to evaluate some things before runtime (at "expand time" or "compile time"). The resulting transformed code could be a simple literal like "<html> ... </html>". Or the code might need further evaluation at runtime -- which is roughly like the precomputed HTML containing JavaScript to do things at runtime. |
|
http://haunt.dthompson.us