PitchHut logo
lips
A powerful Scheme-based Lisp interpreter written in JavaScript.
Pitch

LIPS offers a powerful Scheme-based Lisp interpreter built using JavaScript. It provides seamless interaction with JS, allowing developers to harness the full capabilities of JavaScript, Lisp, and npm together. Perfect for building versatile applications with a unique programming approach.

Description

LIPS is a robust Scheme-based Lisp interpreter built in JavaScript that enhances interaction with existing JavaScript platforms. Designed to comply with the R5RS and R7RS specifications, LIPS unlocks the full potential of both JavaScript and Lisp, providing a versatile environment for developers. This interpreter functions seamlessly in both browser environments and Node.js, making it highly accessible for various applications.

Key Features

  • Literal Regular Expressions: Simplify pattern matching with native support for regular expressions.
  • Asynchronous Execution: Integrate JavaScript promises efficiently, allowing for non-blocking operations.
  • Custom Syntax Extension: Easily add new syntax features, similar to JavaScript objects and arrays.
  • Complete Numerical Support: Utilize advanced mathematical capabilities with Big Integer support and a full numerical tower.
  • Introspection Capabilities: Inspect and understand the language environment and objects dynamically.
  • JavaScript Integration: Leverage JavaScript libraries and code directly within LIPS.
  • Code Formatting: Utilize built-in pretty printing for improved readability of code.
  • Macros Support: Implement Lisp and hygienic Scheme macros, including macro expansion features.
  • Built-in Help System: Access assistance directly within the interpreter, promoting self-learning and exploration.

Getting Started

Usage in Browser

Incorporate LIPS into web pages using script tags:

<script type="text/x-scheme" bootstrap>
(let ((what "world")
      (greet "hello"))
   (display (string-append greet " " what)))
</script>

Or reference an external source:

<script type="text/x-scheme" bootstrap src="example.scm"></script>

Usage in Node.js

Access the REPL with the following command:

lips

For scripting, use shebang:

#!/usr/bin/env -S lips
(print "Hello, world!")

After saving this to hello.scm, make it executable and run it:

chmod a+x hello.scm
./hello.scm

Performance Considerations

As a tree-walking interpreter, LIPS may experience performance lags when processing lengthy arrays or when using complex callbacks, particularly within frameworks like React. Strategies such as writing performance-intensive tasks in JavaScript can mitigate these issues.

Supported Standards

LIPS supports various SRFIs (Scheme Requests for Implementation) which enhance its functionality:

  • SRFI-1: List Library
  • SRFI-22: Running Scheme Scripts on Unix
  • SRFI-176: Version Flag

For a full list of supported SRFIs and additional details, refer to the official documentation.

Community and Collaboration

Engage with the LIPS community on Gitter for discussions or queries. Stay updated on project developments through the official website or follow on Twitter.

By providing a modern Lisp environment within JavaScript, LIPS aims to streamline development processes, enabling users to harness the strengths of both languages efficiently.

0 comments

No comments yet.

Sign in to be the first to comment.