Use Cases Janet makes a good system scripting language, or a language to embed in other programs. Janet also can be used for rapid prototyping, dynamic systems, and other domains where dynamic languages shine. Implemented mostly in standard C99, Janet runs on Windows, Linux and macOS. The few features that are not standard C (dynamic library loading, compiler specific optimizations), are fairly straightforward. Janet can be easily ported to new platforms. While Janet is embeddable, it comes with a bit more out of the box than many other such easily embeddable languages such as threading, networking, an event loop, subprocess handling, regex-like library called PEG, and more. Features Minimal setup - one binary and you are good to go! Builtin support for threads, networking, and an event loop First class closures Garbage collection First class green threads (continuations) Mutable and immutable arrays (array/tuple) Mutable and immutable hashtables (table/struct) Mutable and immutable strings (buffer/string) Macros Tail call optimization Direct interop with C via abstract types and C functions Dynamically load C libraries Lexical scoping REPL and interactive debugger Parsing Expression Grammars built in to the core library 500+ functions and macros in the core library Export your projects to standalone executables with a companion build tool, jpm Add to a project with just janet.c and janet.hCode Example (defn sum3 "Solve the 3SUM problem in O(n^2) time." [s] (def tab @{}) (def solutions @{}) (def len (length s)) (for k 0 len (put tab (s k) k)) (for i 0 len (for j 0 len (def k (get tab (- 0 (s i) (s j)))) (when (and k (not= k i) (not= k j) (not= i j)) (put solutions {i true j true k true} true)))) (map keys (keys solutions))) (let [arr @[2 4 1 3 8 7 -3 -1 12 -5 -8]] (printf "3sum of %j: " arr) (printf "%j" (sum3 arr)))Try It Usage A REPL is launched when the janet binary is invoked with no arguments. Pass the -h flag to display the usage information. Individual script...
First seen: 2025-07-27 07:21
Last seen: 2025-07-27 11:24