SLip — a Lisp system in JavaScript
Features
Update (Oct. 2025): a lot of CL features have been implemented, such that I was able to compile Closette source code almost as-is, with only trivial changes. There's still a long way to go, but this is becoming Common Lisp!
- Self-hosting compiler
- Lexical and dynamic variables
-
TAGBODY
/GO
,THROW
/CATCH
,BLOCK
/RETURN
,UNWIND-PROTECT
- Tail call optimization
- Scheme-like first-class continuations (not to be used with unwind-protect though)
-
Scheme-like named
LET
— useful for looping via recursion. - Separate function/variable namespace (that might be a “misfeature”, depending how you look at it).
- Common Lisp-like symbols/package system
- Standard CL lambda keywords (
&optional
,&rest
,&key
etc), with good performance - Multiple-values with good performance —
MULTIPLE-VALUE-BIND
should be as fast asLET
, and returning multiple values from a function should not involve any measurable performance penalty when only the main value is expected. - Proper setters (
SETF
along with the underlying machinery —DEFINE-SETF-EXPANDER
etc.) - Type system (
DEFTYPE
,TYPEP
,TYPECASE
); noSUBTYPEP
for now. - Structures (
DEFSTRUCT
) - CLOS — via Closette
- Both structures and classes are integrated with the type system, but
however not with themselves yet; that is,
DEFSTRUCT
doesn't also define a class. - Condition system based on CLOS
(
HANDLER-BIND
,HANDLER-CASE
,IGNORE-ERRORS
) LOOP
,FORMAT
and a pretty printer (incomplete but still useful)- List and sequence functions (
FIND
,REMOVE-IF
etc.); but sequence functions only operate on lists for now. - A (tiny) subset of ansi-test, which was instrumental for maintaining my sanity while developing this.
- Tons of primitive functions
- A simple “foreign function interface” for writing functions in JavaScript
- Most basic datatypes are unboxed—strings, numbers, vectors, regexps—so they can be freely passed around to JavaScript functions
- Literal regexps —
#/seriously/i
- Green threads with a simple scheduler
- An in-browser development environment inspired by Emacs and SLIME (based on Ymacs).
Live demo
SLip
A Lisp environment for the browser.
Open the REPL!- Hacking (NEW)
- 9 minute screen cast (old)
- IDE information
- Implementation notes
- Versus Common Lisp
- Documentation
- Project at Github
Latest Lisp blog entries
- SLip news - more Common Lisp! (Oct 5)
- SLip — a Lisp system in your browser (Apr 12)
- A little JavaScript problem (Nov 25)
- QUEEN, chess, and writing fast Lisp code (Aug 29)