Why Janet? (2023)

251 points · 117 comments on HN · read original →

Janet is a small Lisp dialect suited for scripting, CLIs, and side projects due to its simplicity and distributable compiled binaries.

Janet compiles to native executables under 1 MB that statically link the runtime, requiring no dependencies on the user's system. The language has only eight core instructions but supports macros and high-level abstractions. Its standard library fits on one page. Janet uses parsing expression grammars instead of regex for text processing, handles mutable and immutable collections natively, and allows arbitrary compile-time code execution with full state serialization. The language avoids Lisp tradition (using `first` instead of `car`, `fn` instead of `lambda`) and includes a shell scripting DSL via the `sh` library. Janet is embeddable in C programs and websites.

What HN community is saying

Commenters raised two main objections: s-expression syntax readability (though some countered that editor tools like Parinfer mitigate this, and that most languages have syntax editors manage anyway) and lack of static typing. Performance comparisons noted Janet is roughly as fast as Lua. One commenter corrected that `first` and `rest` actually appear in McCarthy's original 1959 LISP definition, predating the `car`/`cdr` IBM 704 implementation. A separate thread debated AI's presence in online communities, with suggestions like Lobsters' web-of-trust and identity verification systems.