Fri Feb 9 10:37:59 GMT 2007
let's see.. what does lambda do? actually two things:
* functions as values (delayed evaluation)
* locally (lexically) defined names
i already have the first one as quoted programs. so the problem i
should be solving is not the lambda problem comprising both
subproblems, but only the latter subproblem: lexical variable
binding. this is forth's "locals".
some more ideas: write the interpreter in Y-combinator form
(CPS?). this would allow the interception of invocations, basicly
allowing any kind of binding of the state that's passed around. maybe
this is the interesting problem for today?
btw. i ordered friedman's "Essentials of Programming Lanugages". First
edition got it very cheap on amazon. Now reading "The Role of the
Study of Programming Languages in the Education of a Programmer."
Done. Gives me a bit of good faith that i'm on the right track. I just
need to study and experiment more.. and learn to smell ad-hoc
One of the things the paper mentions is that it is a good thing to
learn to implement your own abstractions / language extensions /
... and to invest some time into learning the general abstract ideas
behind language patterns, mainly (automatic) correctness preserving
It looks like the approach Friendman suggests is kind of radical. I'm
doing this from a Forth and Lisp perspective for quite a while now,
but it looks like i am getting stuck in certain simple
paradigms. Rewriting BROOD kicked me out of that and made me think
about better approaches, adopting pattern matching, a static language
and lazy compilation.
The idea with PF as one of the BROOD targets is probably a good
idea. It's going to be a hell of a problem to tackle though.
things to try:
- convert the dynamicly bound code in BADNOP to something i can run on
the new core.ss : this approach seems like a nice one and i can't
really say why.. there's the idea that dynamic binding is bad, but
it's quite handy from time to time (i use it in PF C code all over
the place). why is this? and what should be the proper construct?
- see what CPS can bring. for one, it should make control structures a
lot easier to implement. so THAT is what i was looking for. obvious
in hindsight. but how to do this practically?