Lips Scheme – Powerful Scheme Based Lisp in JavaScript

sourdecor1 pts0 comments

Powerful Scheme interpreter in JavaScript | LIPS Scheme

Skip to main content<br>Summary​<br>LIPS Scheme is a powerful lisp interpreter written in JavaScript. The aim of the project is to create a fully R7RS-compliant Scheme in JavaScript.<br>The name LIPS is recursive acronym which stands for LIPS Is Pretty Simple . Over time the project may no longer be that simple in implementation but it always be LIPS.<br>Features​<br>Most important features of LIPS:<br>Great integration with JavaScript. You can use any JS library out of the box.<br>Asynchronous execution (auto resolving of promises with optional promise quotation).<br>Literal regular expression.<br>Functional helpers (inspired by RamdaJS and Lodash).<br>Possibility modify the parser at runtime (add new syntax, similar to vectors and object).<br>Possibility to set representation of new data types for write and display. With parser extensions you can make new data types have different syntax and still be homoicoic.<br>Small JavaScript core with Standard Library implemented in basic Scheme.<br>Full support of Unicode and Emoji.<br>Support for SXML, that allow to write JSX e.g. with Preact or React apps.<br>I/O Ports supports in browser with BrowserFS.<br>Full numerical tower and Big Integer support (still not 100% fully unit tested).<br>Powerful introspection (similar to the one in Python).<br>Auto formatting of lisp code (pretty print).<br>Lisp/hygienic macros and macroexpand.<br>Builtin help system.

Tools​<br>Bookmarklet<br>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. You can also just click the link.<br>The bookmark can also be used to add REPL to your LIPS Web application.<br>It may not work on sites that are protected with Content Security Policy. CSP was created mostly as a security solution to prevent XSS vunerablities. You can disable this mechanism with Chrome Extension, but you do this on your own risk.

Screenshooter<br>This tool allow you to create nice screenshot of code. The screenshot tool is aware of any syntax added on top of Scheme. The tool is created using Codemirror and custom style build on top of Scheme syntax.<br>You can use this tool to generate snippets of Scheme or LIPS Code and share it on social media.

Video Presentation about LIPS Scheme​<br>Video presentation given during FOSDEM 2023 in Declarative and Minimalistic Computing devroom. It discuss different aspect of LIPS Scheme. It first gives quick intro to Lisp and Scheme and later show different features of LIPS Scheme.

Acknowledgments​<br>Font used in logo is Telegrafico by ficod.<br>Cover image for GitHub and blog posts use clipart by Baptiste Gaultier<br>Part of the current parser is inspired by implementation in BiwaScheme by Yutaka HARA (yhara).<br>fetch polyfill use unfetch by Jason Miller.<br>Browser init function use ContentLoaded.<br>The rationalize algorithm is based on Kawa Scheme by Per M.A. Bothner, Alan Bawden and Marc Feeley.<br>ucs2decode function taken from punycode.js by Mathias Bynens.<br>Rosetta Code was used for:gcd,<br>lcm,<br>LFloat::toRational.

StackOverlow code was used for functions:fworker,<br>flatten,<br>allPossibleCases.

Code formatter is roughly based on scheme-style and GNU Emacs scheme mode.<br>Some helpers in standard library are inspired by same functions from RamdaJS library.<br>Thanks to JS.org for providing free domain.<br>Special thanks:Lassi Kortela for helping with Scheme code.<br>Niels Wijers for handing over the lips npm name

License​<br>LIPS Scheme is Open Source and released on MIT license

scheme lips code javascript lisp powerful

Related Articles