The Janet Language

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.h

Code 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 scripts can be run with janet myscript.janet

If you are looking to explore, you can print a list of all available macros, functions, and constants
by entering the command all-bindings into the REPL.

$ janet
Janet 1.17.0-local linux/x64 - '(doc)' for help
repl:1:> (+ 1 2 3)
6
repl:2:> (print "Hello, World!")
Hello, World!
nil
repl:3:> (os/exit)
$ janet -h
usage: janet [options] script args...
Options are:
  -h : Show this help
  -v : Print the version string
  -s : Use raw stdin instead of getline like functionality
  -e code : Execute a string of janet
  -E code arguments... : Evaluate  an expression as a short-fn with arguments
  -d : Set the debug flag in the REPL
  -r : Enter the REPL after running all scripts
  -R : Disables loading profile.janet when JANET_PROFILE is present
  -p : Keep on executing if there is a top-level error (persistent)
  -q : Hide logo (quiet)
  -k : Compile scripts but do not execute (flycheck)
  -m syspath : Set system path for loading global modules
  -c source output : Compile janet source code into an image
  -n : Disable ANSI color output in the REPL
  -l lib : Import a module before processing more arguments
  -w level : Set the lint warning level - default is "normal"
  -x level : Set the lint error level - default is "none"
  -- : Stop handling options

Modules and Libraries

See some auxiliary projects on GitHub. Here is a short list of libraries
for Janet to help you get started with some interesting stuff. See the Janet Package Listing
for a more complete list. Packages in the listing can be installed via jpm install pkg-name.

  • Circlet – An HTTP server for Janet
  • Joy Web Framework – Framework for web development in Janet
  • JSON – A JSON parser and encoder
  • SQLite3 – Bindings to SQLite
  • WebView – Spawn a browser window for creating HTML+CSS UIs on any platform
  • Jaylib – Bindings to Raylib for 2d and 3d game development
  • JHydro – Cryptography for Janet
  • JanetUI – Bindings to libui

For editor support:

Feel free to ask questions and join discussion on the Janet Gitter Channel.
Gitter provides matrix and IRC bridges as well for users who prefer those.

Other Gitter Rooms

  • help:
    For getting help with specific problems in the Janet language.
  • website:
    For discussion and help related to this website and documentation.

Forum

We use GitHub Discussions as our forum, which is more suited to long-form discussion than Gitter.

Janet Docs

For help, you can also check out Janet Docs for Janet documentation with user-provided examples. Feel free to contribute your own examples here to help fellow programmers.

Read More
Erasmo Mcnaught

Latest

Festering Infections to Untreated Cancer: ICE Detainees Describe Medical Neglect Across US

An Albanian man’s pain grew so unbearable, he said, he pulled out his own tooth as he languished for months in a New Mexico immigration detention center. A Honduran mother of two said she was hospitalized for a heart problem after she was denied blood pressure medications while held in Florida. A Venezuelan man said

Focused on Work, Needed at Home: A Federal Caregiving Policy Might Help

(Candice Evers for WPLN and KFF Health News) Jill Woodrow reached a tipping point as a caregiver when her mom began struggling to communicate information about her latest doctor appointments. Woodrow’s mother, a uterine cancer survivor, was seeing specialists to get to the bottom of several new, concerning symptoms. “When she would try to tell

How digital platforms and policy shifts reshape GLP-1 affordability

🛡️ Just a quick check We’re checking your connection to prevent automated abuse

Baffling. Frustrating. Frightening. What It’s Like To Be Sued Over Medical Debt.

When Christine Wood received a $12,000 bill from Bristol Hospital, she thought it must be a mistake. It was more than she and her husband made in a month combined. “I’m freaking out,” said Wood, who lives in a 1,700-square-foot home in Terryville, a village just outside Bristol, Connecticut. “I don’t understand it.” Wood, 52

Newsletter

Don't miss

Festering Infections to Untreated Cancer: ICE Detainees Describe Medical Neglect Across US

An Albanian man’s pain grew so unbearable, he said, he pulled out his own tooth as he languished for months in a New Mexico immigration detention center. A Honduran mother of two said she was hospitalized for a heart problem after she was denied blood pressure medications while held in Florida. A Venezuelan man said

Focused on Work, Needed at Home: A Federal Caregiving Policy Might Help

(Candice Evers for WPLN and KFF Health News) Jill Woodrow reached a tipping point as a caregiver when her mom began struggling to communicate information about her latest doctor appointments. Woodrow’s mother, a uterine cancer survivor, was seeing specialists to get to the bottom of several new, concerning symptoms. “When she would try to tell

How digital platforms and policy shifts reshape GLP-1 affordability

🛡️ Just a quick check We’re checking your connection to prevent automated abuse

Baffling. Frustrating. Frightening. What It’s Like To Be Sued Over Medical Debt.

When Christine Wood received a $12,000 bill from Bristol Hospital, she thought it must be a mistake. It was more than she and her husband made in a month combined. “I’m freaking out,” said Wood, who lives in a 1,700-square-foot home in Terryville, a village just outside Bristol, Connecticut. “I don’t understand it.” Wood, 52

Former Angels Top Prospect Jordyn Adams, 26, Commits To SMU Football

The 2018 wide receiver recruiting class was spearheaded by top prospects Amon-Ra St. Brown and Ja’Marr Chase. Both elite talents lived up to the immense hype and have since become All-Pro receivers in the NFL. Lost in that group was the player who sat between Brown and Chase in the rankings — a once highly-touted

Jury acquits 2 business executives of bribing Navy admiral for government contract

A federal jury has acquitted two business executives of charges that they conspired to bribe a retired four-star U.S. Navy admiral, who is now serving a six-year prison sentence for his conviction on corruption charges By MICHAEL KUNZELMAN Associated Press WASHINGTON -- A federal jury has acquitted two business executives of charges that they conspired

US Business Leaders Optimistic About China Cooperation, Emphasize Importance of Chinese Market

© 2026 China Money Network. All Rights Reserved. Disclaimer: The views, opinions, forecasts, and statements made by our hosts and guests are the personal views of those respective individuals and may or may not be either endorsed or accepted by China Money Network Limited or the companies with which these individuals are employed.

Tesla’s Business Has Become Much More Diversified in Just the Past Five Years. Does That Make Its Stock a Better Buy Today?

Key Points Tesla's energy generation and storage segment generated 27% revenue growth last year. The company's non-automotive segments were able to help offset a double-digit decline in auto revenue in 2025. These 10 stocks could mint the next wave of millionaires › Tesla (NASDAQ: TSLA) is known for its electric vehicles (EVs), and while they