← All projects
Project record1 mention
Originally shared on Hacker News

TXR Lisp

TXR Lisp, a Lisp implementation running on a custom VM, gains proper tail call support. The current release provides self tail calls only, with apply-in-tail-position and a shadowing bug already fixed. The next phase implements tail calls between different VM functions by reallocating the frame in place (using alloca for frame size differences), smuggling arguments during in-place reinitialization, and a new "tail" prefix instruction before call/apply/gcall/gapply that terminates the VM dispatch loop and triggers the tail call logic.

Last shared
01 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. TXR Lisp

    TXR Lisp, a Lisp implementation running on a custom VM, gains proper tail call support. The current release provides self tail calls only, with apply-in-tail-position and a shadowing bug already fixed. The next phase implements tail calls between different VM functions by reallocating the frame in place (using alloca for frame size differences), smuggling arguments during in-place reinitialization, and a new "tail" prefix instruction before call/apply/gcall/gapply that terminates the VM dispatch loop and triggers the tail call logic.

    Posted by @kazinator · Original source ↗

    Source text · @kazinator · · Source ↗

    Working on tail calls for TXR Lisp. Current release provides self tail calls only; and certain cases don't work, like applying in tail position. Plus there is a shadowing bug. These issues are addressed already.