Wed Aug 13 09:29:23 CEST 2008
Coma code + instantiation
Maybe it's time to start moving things from Forth syntax to Coma/sexp
syntax. What's currently missing is an instantiation syntax for Coma
words. Something like:
;; Define code generators
(compositions (macro) macro:
(a 1 2 3)
(b a c)
(c a b))
;; Declare which of them employ run-time instantiation.
(instantiatie (macro) c b)
* Recursive macros. During instantiation some recursive expansions
might lead to infinite code size. This needs a detection
mechanism and possibly automatic instantiation.
* Fallthrough and multiple exit points. This needs special
syntactic support. Moreover, the ';' used in Forth is awkward to
use in Scheme syntax.
* Somehow it feels wrong to use Forth's structured programming words
in the s-expression definitions. Code blocks in the form of
higher order macros seem to make more sense there.. Is this just
The fallthrough/local-exit problem could be avoided by not allowing
them in a simple version of 'instantiate'. The cost of these features
needs to be analyzed more: they are not for free and significantly
complicate the code graph instantiator.