Re: [stack] More stack effect work

Paul-V Khuong — 2004-11-07 19:16:39

> Message: 1
> Date: Sat, 06 Nov 2004 22:54:40 -0500
> From: Slava Pestov <slava@...>
> Subject: More stack effect work
>
> Hi everybody,
>
> I have posted some more (incomplete for now) stack
> algebra results, as
> well as a detailed description of an actual stack
> effect inference
> algorithm that works with recursive words at
> http://www.jroller.com/page/slava/.
[...]
> It is reasonably complete, however it has some
> limitations:
>
> - While simple recursive words can have their stack
> effects inferred,
> recursive combinators (like each, map, and so on) do
> not.
>
> - Only a small set of primitives has their stack
> effects specified.
>
> Neither of these is unfixable, and the next
> iteration of the code will
> solve them.
[...]
Eager (call-by-name too, possibly) purely functional
(mutating shared closures messes things up) languages
with fixed argument and return value counts can
trivially compile to concatenative languages. If
there's no return stack, only an operator queue, then
the language must simply be CPSed first. I'm pretty
sure that once you get the whole language to be
inferrable, you'll have a trivial isomorphism with
such a language.

It might be that working on the functional language
view will lead to new/easier transformations that
aren't as explicit when viewing the stack-based aspect
of the language. In any case, the amount of previously
made work on the subject of type inference for
functional languages should be helpful.

Paul Khuong



__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com