npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

@jcubic/lips

0.16.2 • Public • Published

LIPS is Pretty Simple

npm travis Coverage Status

LIPS is very simple Lisp, similar to Scheme written in JavaScript.

Demo

Key features

  • Full lisp macros, backquote and macroexpand,
  • Functions in lips are normal JavaScript functions,
  • You can invoke native JavaScript functions and methods from Lips,
  • Promises are treated as values they resolve to (so async code look like sync - like auto async/await),
  • Library agnostic - you can use it with any library,
  • Easy extension using JavaScript using Macros or functions,
  • RegExp-es are first class objects,
  • BigInt support, if your browser don't support them, you will need to use bn.js,
  • Optional dynamic scope.

Installation

use npm

npm install @jcubic/lips

then include the file in script tag, You can grab the version from unpkg.com

https://unpkg.com/@jcubic/lips

or from rawgit

https://cdn.rawgit.com/jcubic/lips/devel/dist/lips.min.js

Usage

Simplest way is to include the lips code in script tag:

<script type="text/x-lips">
(let ((what "world")
      (greet "hello"))
   (print (concat "hello" " " what)))
</script> 

or use src attribute:

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

Running programmatically:

var {exec} = require('@jcubic/lips'); // node
// or
var {exec} = lips; // browser
 
exec(string).then(function(results) {
     results.forEach(function(result) {
        console.log(result.toString());
     });
});

More documentation in Getting Started Guide and in docs page.

License

Released under MIT license

Copyright (c) 2018-2019 Jakub T. Jankiewicz

install

npm i @jcubic/lips

Downloadsweekly downloads

35

version

0.16.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability