View on GitHub

Delisp

A delightful Lisp for JavaScript

Setup

You can use npx to try the Delisp REPL directly:

npx delisp

Or install the Delisp CLI with yarn:

yarn global add delisp

After installing, you can start the REPL by running delisp. Compile files with delisp compile <file.dl>.

Features

Example code

(print "Hello World!")

(define numbers [1 2 3 4 5])
(define total (fold + numbers 0))

(define create-user
  (lambda (name age)
    {:name name :age age}))

(define print-name
  (lambda (user) (print (:name user))))

(define factorial
  (lambda (n)
    (if (zero? n)
        1
        (* n (factorial (- n 1))))))

(export factorial)