On Thu, 2009-09-17 at 23:41 -0700, Dominikus wrote: > > It looks like Dominikus's expand-time rewriting stack-lang kernel only > > works at expand-time, which doesn't fit with my goals. I already had > > some other ideas for using macros to inline the core operators, which > > I'll explore now... > > That was the point of my "exercise": to have an implementation that > runs > at macro-expand-time (m-e-t) only. You can also go for a mixed > approach > and have a run-time kernel (also for interoperating with R6RS) but > benefit > from rewriting optimizations at m-e-t. Meaning that defining new words > (typically program stack transformations) would result in the creation > of > rewriting macros. This might fit more your goals but still ensure > high-speed execution.
If having it execute at run time requires the data stack and program stack to exist at run time, how would a mixed approach do anything, which integrates with the run-time side, at expand time? Expand time doesn't have access to the stacks because they don't exist at that time. How would the two sides integrate? I.e., how would they share their stacks, and how would they syntactically mix? I can see that a very limited set of programs could be transformed at expand time, but it seems like those that could wouldn't happen because they're silly programs. E.g., in my notation, the program (S 1 2 3 swap dup) could be transformed at expand time to (S 1 3 2 2). But why would anyone write a program like that? If, at expand time, the relevant portion of the data stack is not known, which I think is nearly always the case, how could expand-time rewriting help? Sorry if I'm missing something. I'd love to see how to do it. -- : Derick ----------------------------------------------------------------
