Registry / sibilisp

sibilisp

JSON →
library0.14.2jsnpmunverified

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.

npm install sibilisp
INSTALL
IMPORT
SIG · SIBILISP
S
sibilisp
javascriptv0.14.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import sibilisp from 'sibilisp'
The package is primarily used as a CLI tool; importing it as a module is uncommon but supported.
compile
import { compile } from 'sibilisp'
const { compile } = require('sibilisp')
ESM-only in modern versions. CommonJS require may work if package supports it, but ESM is preferred.
prelude
import { prelude } from 'sibilisp/prelude'
import prelude from 'sibilisp'
The prelude is a separate module; importing from the main package will not include it.
repl
import { repl } from 'sibilisp/repl'
REPL functionality is exported from a subpath; ensure your bundler supports package exports.
SibilispError
import { SibilispError } from 'sibilisp'
Custom error class for compilation errors.

Install Sibilisp globally, write a simple LISP-like program greeting the user, transpile to JavaScript, and run it.

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!
sibilisp --version
Debug
Known issues
breakingVersion 0.12.0 changed the default output directory from 'build/' to 'dist/'.
fix
Use `--out-dir` flag to specify custom output directory.
affects: >=0.12.0 <0.13.0
deprecatedThe `--modules` flag is deprecated in favor of `--module-system`.
fix
Replace `--modules commonjs` with `--module-system commonjs`.
affects: >=0.14.0
breakingRemoved support for Node.js versions < 12.
fix
Upgrade Node.js to 12 or later.
affects: >=0.15.0
gotchaMacros defined in one file are not visible in other files unless explicitly imported.
fix
Use `(import-macros ...)` to share macros across files.
affects: >=0.10.0
gotchaTail recursion optimization only works with explicit `recur` form; plain recursive calls may cause stack overflow.
fix
Use `(recur ...)` inside `loop` for tail-call optimization.
affects: >=0.9.0
deprecatedThe `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`.
affects: >=0.14.0
Errors
Common errors & fixes
Error: Cannot find module 'sibilisp/prelude'
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).
SyntaxError: Unexpected identifier
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.
sibilisp: command not found
Not installed globally or not in PATH.
fix
Run `npm install -g sibilisp` or use `npx sibilisp`.
TypeError: (intermediate value) is not a function
Missing parentheses or incorrect macro expansion.
fix
Wrap function calls in parentheses: `(myfunc arg1 arg2)`. Check macro definitions.
Error: Unsupported node version. Please use Node.js 12 or newer.
Using an outdated Node.js version.
fix
Upgrade Node.js to version 12 or later.
Upgrade
Version history
0.14.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources