[<<][staapl][>>][..]
Fri May 8 14:44:26 CEST 2009

lazy partial evaluation

I'm trying to find the proper type of lazy evaluations in Staapl,
inspired by [1].  Something like this:

(define-virtual-ops
  (mw a))

(patterns
 (macro)

 (([mw a] [mw b] +) ([mw (macro: ,a ,b _+)]))
 (([qw a] delay)    ([mw (macro: ',a)]))
 (([mw m] force)    m)

 )


Here _+ is the stict one from pic18.ss
To use this in the strict (macro: ...) form do something like:

   1 delay 2 delay + force


Now, what I wonder is how this can be used to separate all compile
time computations (manipulation of qw's) from target compilation
(using target machine code only).

There is one thing though that I didn't do yet from [1]: I made
closures, but not abs's.  "Indirections represent a logical reordering
of the stack, and are used to model bound variables."

What I don't quite understand is why this needs to pop the element
referred to.

Anyways: a basic idea is that if you use a stack and start to reorder
operations on it, you had better kept track of the original positions
of the operations.


[1] http://lukepalmer.wordpress.com/2009/05/04/lazy-partial-evaluation/



[Reply][About]
[<<][staapl][>>][..]