LIPS Logo: Scheme (lisp dialect) in JavaScript

Powerful Scheme lisp in JavaScript

Summary

LIPS is poweful Scheme based lisp language written in JavaScript. The name is recursive acronym which stands for LIPS is Pretty Simple. The interpreter have very good integration with JavaScript.

Key features of the interpreter:

Demo

Check Getting Started Guide and try the interpreter while you will read the document.

1.0.0 Beta version

To test latest beta version of the language, check LIPS Beta Demo. Documentation (WIP) for version 1.0.0 can be found on Wiki.

Bookmarklet

When you're learning Scheme language, you can run the REPL directly on any page that have Scheme tutorial you're learning from. It even work with PDF files and new empty tab (at least in Chrome). Drag this link LIPS REPL to your bookmarks. When you click on the bookmark it will run the interpreter.

The bookmark can also be used to add REPL to your LIPS Web application.

NOTE: it will not work on this page, because it already have terminal on it and because it have not compatible LIPS version included.

Browser

When using LIPS interpreter in browser you need to include the main script file.

If you want to use Webpack see wiki page for details.


<script src="https://unpkg.com/@jcubic/lips"></script>
    

You can put LIPS code directly in script tag:


<script type="text/x-lips">
  (print "hello")
  ;; this will load and evaluate external file
  (load "example.lips")
<script>
    

You can also use src attribute to link to source file.


<script type="text/x-lips" src="example.lips"><script>
    

Node


npm install -g @jcubic/lips
    

To install 1.0.0 beta version use:


npm install -g @jcubic/lips@beta
    

## if installed as global just use
lips
lips foo.lips
## you can also run code as string
lips -c '(print "hello world")'
    

You can also write scripts using LIPS with shebang

Crete file foo.lips


#!/usr/bin/env lips
(let ((what "World"))
  (print (concat "Hello " what)))
    

Then run


chmod a+x foo.lips
./foo.lips # or just foo.lips depend on your $PATH
    

Direct API

You can also run execute LIPS programaticaly (in Node.js/Webpack).


var lips = require('@jcubic/lips');
// or
import lips from '@jcubic/lips';
    

Then use it like this:


lips.exec("(let ((a 10) (b 20)) (* a b))").then(result => {
   // result is always array
   const [value] = result;
   console.log(value);
});