archives

Compiling tail-calls to simple C?

I'm writing a Lisp-to-C compiler, trying to keep compiler and runtime very simple and close to C, because I want to embed the language into C applications, and use C libraries.

My closures are structs with a C function pointer and an environment.

Ideally, I'd like the language to be properly tail-recursive like Scheme; however, without resorting to techniques like trampolines, Cheney on the M.T.A., or putting the whole program into one function, it seems that the only possible thing is what BitC does:

Within any function f, calls to f that appear in tail position w.r.t. the body of f must be tail recursive.

[...]

Within a letrec, calls to any function bound in the letrec that appear in tail position within some function bound by the letrec must be tail recursive.

These requirements apply only to function calls whose destination can be statically resolved by the compiler at compile time.

What do you think about this restriction?

Does anyone have experience with the new tail call optimization of GCC, especially when making an indirect call via a function pointer?

LCA2007: Concurrency and Erlang

Extremely attractive overview and slides about a one-hour Erlang talk by André Pang at linux.conf.au 2007.

I gave a talk titled Concurrency and Erlang at Linux.conf.au in January, 2007. Thank you so much to everybody who attended it and made me feel welcome: I got overwhelmingly positive feedback from it, and it was an honour to speak at such an esteemed conference.

Another reason I wish I'd talked myself into attending this conference!