playing with "runtime compilation" in haskell

2012-02-23 02:39:20
playing with "runtime compilation" in haskell
Runtime compilation is just an idiom in which you return a carefully constructed function that does the work you want done in place of writing an interpreter to do the work directly. Supposedly more stuff can be memoized this way, but I'm sure it all depends on how you work it. In this example, the user enters a program in a simple language in an interactive shell (a language where there is one character per opcode). This program is "compiled" into opengl commands, and the resulting program is cycled into an infinite list where only the first 1000 elements will be executed.
311 views · 0 faves · CC BY 2.0
Original Flickr page