Mon Aug 20 23:03:09 CEST 2007
i'm starting an explanation of macro embedding with a purely
functional approach. while i'm on the right way with my notion of
compilable, the effectful part is less obvious.
the idea is this: [ a 1 2 + b ] can be simplified to [ a 3 b ] if a
and b are effects.
somehow i'm missing something important.
maybe the situation is symmetric? instead of having language and
metalanguage, which both share some evaluation domain, they also have
functions that act on their full domain only.
i think i sort of got the duality now: the target depends on run time
state which is not representable, meaning only pure functions can be
my explanation is not completely sound.. when i'm talking about target
and host langauge, i never make the explicit conversion. there's
something wrong there. almost right, but not quite.
a compilable macro is something which can be 'unpostponed'. meaning,
it is a function that all by itself produces a program that can be
evaluated on the target.
another thing is that macros, in the way i implement them, are not the
macros i'm describing in the paper.
my macros are EAGER, they are a combination of the partial evaluation
strategy AND their original meaning.
the macros in the paper, at least the partial evaluation strategy, is
monadic. for compilable macros this makes no difference, but for other
algorithms, order does matter.