Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

willhbr/lisp.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lisp.js

Install for CLI:

npm install @javanut13/lisp.js -g

Run it from the command line:

lispjs -x my_lisp_file # execute the file
lispjs -c my_lisp_file # print the JS version of the file
lispjs -c my_lisp_file -o transpiled.js # Write the transpiled file

Include it in a webpage:

<script src="lisp-web.min.js"></script>
'(console.log "Hello world")'.evalLisp();
'(console.log "Hello world")'.toJS();

Syntax

(:length my_array) ; get the length (or another property) from an object
(.substring "Foobar" 3) ; call a method on an object
(defn func [a b] (console.log (+ a b))) ; create a function

The syntax is mostly Clojure-esque.

About

Lisp to JS Transpiler

Resources

Stars

Watchers

Forks

Packages

No packages published