Sibilisp
raw JSON → 0.14.2 verified Fri May 01 auth: no javascript
A LISP-like language dialect based on Sibilant that transpiles to JavaScript. Current stable version is 0.14.2. Sibilisp enhances Sibilant with ES2015+ module system, promises, default arguments, generators, tail recursion via loop/recur, functional programming primitives, and sum/tagged types. It compiles .slisp, .sibilant, and .js files into readable JavaScript without prototype pollution. Differentiators include built-in prelude module (like Lodash), pattern matching macros, and a focus on functional programming while remaining multi-paradigm.
Common errors
error Error: Cannot find module 'sibilisp/prelude' ↓
cause Importing prelude from wrong path or bundler not resolving subpath exports.
fix
Use
import { prelude } from 'sibilisp/prelude' and ensure your bundler supports package exports (exports field in package.json). error SyntaxError: Unexpected identifier ↓
cause Using JavaScript keywords or invalid LISP syntax in .slisp file.
fix
Ensure all s-expressions are correctly parenthesized and no stray JavaScript code is present.
error sibilisp: command not found ↓
cause Not installed globally or not in PATH.
fix
Run
npm install -g sibilisp or use npx sibilisp. error TypeError: (intermediate value) is not a function ↓
cause Missing parentheses or incorrect macro expansion.
fix
Wrap function calls in parentheses:
(myfunc arg1 arg2). Check macro definitions. error Error: Unsupported node version. Please use Node.js 12 or newer. ↓
cause Using an outdated Node.js version.
fix
Upgrade Node.js to version 12 or later.
Warnings
breaking Version 0.12.0 changed the default output directory from 'build/' to 'dist/'. ↓
fix Use `--out-dir` flag to specify custom output directory.
deprecated The `--modules` flag is deprecated in favor of `--module-system`. ↓
fix Replace `--modules commonjs` with `--module-system commonjs`.
breaking Removed support for Node.js versions < 12. ↓
fix Upgrade Node.js to 12 or later.
gotcha Macros defined in one file are not visible in other files unless explicitly imported. ↓
fix Use `(import-macros ...)` to share macros across files.
gotcha Tail recursion optimization only works with explicit `recur` form; plain recursive calls may cause stack overflow. ↓
fix Use `(recur ...)` inside `loop` for tail-call optimization.
deprecated The `prelude` module's `map` function is being renamed to `fmap` to avoid conflict with JS Array.prototype.map. ↓
fix Use `prelude.fmap` instead of `prelude.map`.
Install
npm install sibilisp yarn add sibilisp pnpm add sibilisp Imports
- default
import sibilisp from 'sibilisp' - compile wrong
const { compile } = require('sibilisp')correctimport { compile } from 'sibilisp' - prelude wrong
import prelude from 'sibilisp'correctimport { prelude } from 'sibilisp/prelude' - repl
import { repl } from 'sibilisp/repl' - SibilispError
import { SibilispError } from 'sibilisp'
Quickstart
npm install -g sibilisp
echo '(defun hello (name) (print (+ "Hello, " name "!")))
(hello "World")' > hello.slisp
sibilisp hello.slisp -o hello.js
node hello.js
# Output: Hello, World!