Gay Lisp is open source and we need your help! Can you:
Check out the TODO for more ideas.
Lisp is one of the oldest and most influential programming languages. Kind of like Latin is to European languages.
Scheme is a modern dialect of Lisp, renowned for its beauty but seldom used in the real world. Kind of like Italian.
An interpreter for R5RS Scheme that runs in the browser, no plugins or downloads required. You can also run it on a server, using Node.
If you are reading this, Gay Lisp is probably running on your device.
Gay Lisp is written in an unfancy version of JavaScript that has been included in browsers for more than a decade, so it should work in most browsers as long as JavaScript is not disabled.
This website, however, uses some more recent bells and whistles, so an up-to-date browser is recommended.
There is a regex-based scanner and a recursive descent parser, both handwritten.
Programs are incrementally transformed into continuation-passing style and evaluated on a trampoline.
Primitive Scheme values are implemented by their primitive JavaScript counterparts as much as practical; in particular, the semantics of numerical operations are mostly those of JavaScript, while still complying with the Scheme standard.
All the non-primitive syntax and procedures are written in Scheme and loaded at boot time.
Yes. Gay Lisp is the first standards-compliant Scheme that runs in the browser.
Most JavaScript Scheme implementations provide a useful subset of Scheme without aiming for compliance with any standard. Typically, this means standard features that significantly complicate the implementation are omittted:
dynamic-wind, call-with-values, etc.)do.By contrast, Gay Lisp aims for complete compliance with R5RS. You can jump between the specification and the implementation in order to test features. And you can run every example in the specification straight from the specification.
As of early 2012, work on future Scheme standards has split in two. One of these standards could abrogate features introduced by R6RS.
There is some experimental DOM interoperability:
A medium-term goal is to replace the interpreter with a JavaScript code generator. When this is done, Scheme will be able to be included in HTML pages in the same manner as CoffeeScript.
[Channeling George Mallory and George Costanza] Because it's there.
The penis oo===D is bound to Turing’s normal-order Y combinator. It allows useful things like
This combinator is usually provided in an applicative-order variant in other languages, but Scheme’s macro facility allows the normal-order definition.