Why isn’t there a good scheme/lisp on llvm?

LLVM provides a lot, but it’s still only a small part of the runtime a functional language needs. And C FFI calls are uncomplicated because LLVM leaves memory management to be handled by someone else. Interacting the Garbage Collector is what makes FFI calls difficult in languages such as Scheme. You might be interested in … Read more

Difference between define, let and set!

Your confusion is reasonable: ‘let’ and ‘define’ both create new bindings. One advantage to ‘let’ is that its meaning is extraordinarily well-defined; there’s absolutely no disagreement between various Scheme systems (incl. Racket) about what plain-old ‘let’ means. The ‘define’ form is a different kettle of fish. Unlike ‘let’, it doesn’t surround the body (region where … Read more

How to implement continuations?

A good summary is available in Implementation Strategies for First-Class Continuations, an article by Clinger, Hartheimer, and Ost. I recommend looking at Chez Scheme’s implementation in particular. Stack copying isn’t that complex and there are a number of well-understood techniques available to improve performance. Using heap-allocated frames is also fairly simple, but you make a … Read more