Janet: Lightweight, Expressive, Modern Lisp
What Makes Janet Distinct (vs Scheme/Clojure/CL)
- Not a Scheme: no cons cells; data model is closer to Clojure (maps, vectors, immutable-friendly collections).
- Emphasis on small, self-contained runtime: ~1 MB interpreter; very small bundled executables that run with low RAM usage.
- Positioned by some as “Lispy C” or “native-ish Clojure for scripting,” not as a Common Lisp replacement.
- One commenter sees Guile as faster today; another says Janet is faster than many dynamic languages. Relative performance vs Guile is unclear.
Compilation, Runtime, and Performance
- “Compilation to executables” bundles Janet bytecode plus the VM into a native binary; code remains interpreted inside the VM.
- Distinction debated: some care that this doesn’t improve speed much; others care primarily that users can run binaries without installing Janet.
- Optional type annotations exist but are for documentation, not optimization.
- Roughly Lua-like niche: embeddable C runtime, easy FFI, good for scripting and small apps.
Concurrency, PEGs, and Language Features
- Fibers are core to concurrency and even error handling; suggested as the answer to “async/await.”
- PEGs are heavily featured and praised for readability and power; one commenter links criticism and warns they may be overhyped.
- Homoiconicity is preserved (code-as-data) but without cons cells; some see this as Lisp “heresy,” others as fine so long as macros work.
Tooling and Editor Support
- Complaints about weak REPL/IDE integration, especially in Emacs, but others report working setups:
- Emacs:
janet-ts-mode,ajreplorajsc, tree-sitter configs, netrepl-based workflows, live redefinition. - Neovim: Conjure, paredit, parinfer integration; LSP with reasonable autocomplete.
- Emacs:
- A beginner-friendly online book (janet.guide) is recommended.
Ecosystem, Web, and Libraries
- Standard library provides JSON, HTTPS, PEG parsing, maps, arrays, strings; package manager
jpmis built-in. - Several web frameworks and servers exist (e.g., Joy, used for janetdocs), though maintenance cadence is sparse; code “works as is” but some stewardship is ad hoc.
- Persistent/functional data structures are limited; an experimental library exists but is incomplete and performance is unknown.
jpm’s support for strict reproducibility/lockfiles is questioned; no clear answer given.
GUIs, Games, and Distribution
- No canonical cross-platform GUI toolkit; some disappointment from people wanting “GUI + easy standalone + HTML/JS export.”
- Workarounds:
- Raylib bindings (jaylib) for desktop graphics/games via embedded C libraries.
- TIC-80 integration (with Janet) for small graphical apps, including export options.
- Standalone binaries in practice are seen as a major plus for distributing scripts and small tools.
Developer Experience and Lisp vs OO Style
- Discussion on IDE autocomplete ergonomics: some prefer OO-style
a.method(...); others argue namespace-based or threading-macro styles (foo/bar,->) plus LSP can give good completion in Lisps. - General advice: choose Lisp variant based on platform, ecosystem, and performance needs; Janet fits “small, Lispy, embeddable scripting” rather than “big, optimizing Lisp.”