node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



A dialect of lisp, meant for the Node.js runtime. What's the use of this? Not much other than to just fool around. In fact, I only wrote it to learn compilers.


# Might require sudo 
$ npm install -g decaf-lisp

Copy the code into a hello-world.lisp file.

(console-log "Hello, World!")

And then run the code.

$ decaf-lisp hello-world.lisp
# -> Hello, World! 

More examples


(if (< 5 6)
  ("5 is less than 6!")

If you want the above to outputed to the console, then you would simply prepend the above code with a console-log call.

(console-log (if (< 5 6)
  ("5 is less than 6!")

function definition

(defun myfunc (somParam)
  (console-log someParam))
; Calling the function.
(myfunc "Hello, World!")
; -> "Hello, World!"

Anonymous functions

  ((lambda (one, two)
    (+ one two)) 1 2))
; -> "3"

Factorial function

(defun fact (n)
  (if (= n)
    (* (- n 1) n)))
(console-log (fact 3))


  • command-line options