Registry / roselisp

roselisp

JSON →
library0.0.1jsnpmunverified

Scheme-like Lisp interpreter and transpiler to JavaScript, self-hosted, also provides decompilation from JS to Lisp. Current version 0.0.1 (early development). Key differentiators: supports both interpretation and compilation to JavaScript, includes decompilation, self-hosted, MPL-2.0 licensed unlike many Lisp implementations. Useful for embedding Lisp in JS projects or learning compiler construction.

npm install roselisp
INSTALL
IMPORT
SIG · ROSELISP
R
roselisp
javascriptv0.0.1
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 roselisp from 'roselisp'
const roselisp = require('roselisp')
ESM only; package exports a default export.
interpret
import { interpret } from 'roselisp'
Named export for interpreting Lisp code; available as of v0.0.1.
compile
import { compile } from 'roselisp'
Named export for compiling Lisp to JavaScript.

Imports Roselisp, interprets a Lisp definition, compiles to JS, and decompiles JS back to Lisp using named exports.

import roselisp from 'roselisp'; const code = `(define (hello) (display "Hello from Roselisp!"))`; const result = roselisp.interpret(code); console.log(result); // outputs hello function definition // Compile to JavaScript const jsCode = roselisp.compile(code); console.log(jsCode); // outputs JS representation // Decompile JavaScript to Lisp (if structured) const lispCode = roselisp.decompile('function hello() { console.log("Hello from Roselisp!"); }'); console.log(lispCode);
roselisp --version
Debug
Known issues
breakingESM-only: package does not support CommonJS require()
fix
Use 'import' syntax instead of 'require()'.
affects: >=0.0.1
deprecatedGlobal install may require sudo on Unix systems
fix
Use `npm install -g roselisp` with appropriate permissions or use npx.
affects: >=0.0.1
gotchaAPI may change drastically as version is 0.0.1 (unstable).
fix
Pin exact version or expect breaking changes.
affects: >=0.0.1
gotchaDecompilation is imperfect; only works for JS that matches patterns emitted by compiler.
fix
Use decompile only on JS generated by roselisp's compiler.
affects: >=0.0.1
gotchaInterpreted code runs in a sandboxed environment; no direct Node.js I/O access.
fix
Use JavaScript for I/O, pass data to Lisp via bindings.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'roselisp'
Package not installed or not in node_modules
fix
Run `npm install roselisp` in your project.
TypeError: roselisp.interpret is not a function
Using default import incorrectly; API uses named exports interpret/compile
fix
Use `import { interpret } from 'roselisp'` instead.
SyntaxError: Unexpected token 'export'
Using CommonJS require() with an ESM-only package
fix
Use `import` syntax or enable ESM in package.json: `"type": "module"`.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
roselisp — npm install roselisp · libregistry