On Sun, Jan 26, 2014 at 11:39 AM, Matthias Trute <mtr...@web.de> wrote:

>
> > Of course you'll blow the return stack pretty fast without tail
> > call elimination. I confess I've looked at all the available Forths
> > for the AVR so I can't remember if AmForth provides this
> > capability.
>
> The amforth compiler does absolutely no optimization at all. simple
> and straight 1:1 code generation.
>
>
Certainly that is clear and easy to understand. For a trampoline table it's
quite sufficient to declare the table as a var, then the loop, then the
instructions which call the loop, and lastly stuff the table. The
indirection is not thereby increased, as it would be for a single mutual
recursion.

In avrforth http://krue.net/avrforth/control/ there's a separate `;` and
`;;`. Would it be possible to add a `;;` that behaves like the `;` in
avrforth? An explicit tail call elimination allows for a few recursive
patterns that are quite natural to write. I'm afraid I don't understand
AmForth's model in enough detail to know if this is possible.

cheers,
-Sam.
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to