Janet: a scriptable embeddable language that ships as two C files
A dynamic language and bytecode vm
At a glance
- What is it?
- Janet is a dynamic language and bytecode VM written in C, aimed at system scripting and at embedding inside C and C++ programs. Its core library is larger than Lua's, its footprint smaller than Guile's, and the whole runtime arrives as janet.c and janet.h.
- Who is it for?
- Adopt Janet when you need user scripting inside a C or C++ host, or a small scripting language for automation,. Do not adopt it if you need a large standard library, a stable package tool, or a language whose master branch is already known to be unstable.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.
Star history
- janet-lang/janet4,483 ★ · +60
| Repository | 2026-09-23 | 2026-11-14 |
|---|---|---|
| janet-lang/janet | 4.4k | 4.5k |
60 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The size argument between Lua and Guile
Janet exists because the two common choices for a scripting language inside a C program sit at opposite ends of a size range. The README places it between them directly: it has more built-in functionality and a richer core language than Lua, but smaller than GNU Guile or Python, and it is much easier to embed and port than Python or Guile. That is the whole pitch, and it is a size argument rather than a feature argument.
Who it serves is therefore narrow and clear. Two audiences: people writing system scripts and automation where a Lisp dialect is acceptable, and C or C++ authors who want end users to extend a binary at runtime. For the second group the delivery format is the feature. The runtime ships as janet.c and janet.h, so there is no interpreter binary to install on the target machine and no separate package to version. The tradeoff is that you are compiling a language implementation into your product, which makes every upgrade your problem rather than the package manager's.
The core library carries 600+ functions and macros, and the surface is wide for a language of this size: socket networking, threading, subprocesses, file system access, garbage collection, first-class closures and tail recursion. There is a REPL with a debugger and an inspectable runtime, and script files run under the same client. None of that makes Janet a replacement for Python's standard library. The comparison to make is against Guile, and on that axis the README picks size over breadth.
Embeddability through a C API, natives and the FFI
Embedding runs on three layers, and the choice between them is the design decision an author actually makes. The lowest is the C API in janet.h, which is how the language itself is written in janet.c. The middle layer is natives: C functions compiled and dynamically loaded as plugins, the route the README gives for extending a host. The top layer is the built-in C FFI, which lets a script declare a C function signature in the language itself and call it without writing any C at all.
The FFI is the fastest path to a proof of concept, and the README's Windows example is the whole of it: a context for user32.dll, a defbind giving MessageBoxA a return type of :int and four typed parameters, then the call. No C required, as the comment says. The README frames the FFI as the option for when the native bindings are too much work.
The REPL is not a separate program: the README says the client is separate from the core runtime precisely so the core can be embedded. That split is why the FFI example and the native plugin mechanism can coexist without one being a bolt-on. An author embedding janet.c should diff the C API between the tags they intend to ship.
Continuations for concurrency, one event loop per thread
Janet carries two concurrency models that are usually conflated. The first is first-class green threads implemented as continuations, which lets a script suspend and resume without yielding to the operating system. The second is a per-thread event loop over epoll, IOCP and kqueue, used for IO.
The built-in socket API is written against the event loop, not against OS threads. The README's TCP echo example shows the shape: a handler function that closes the stream in a defer, reads into a buffer, writes it straight back, clears the buffer with buffer/clear, and finally calls ev/sleep 0.5 before the connection is torn down. That last call is the interesting one. Sleeping inside the handler instead of blocking the thread keeps the loop servicing other connections, and it means a slow peer costs one green thread rather than the whole server.
Erlang-style supervision trees integrate with the same loop. What this costs you is a scheduler to reason about. Blocking a thread, or reaching for a C function that blocks, defeats the loop. Scripting for systems work usually means calling out to external programs, so the discipline of never blocking has to be enforced by your own conventions.
Building with make, or trying it in a MUSL container
The README asks you to build from the newest version tag rather than from master, and gives the command to find that tag after cloning: run git checkout $(git describe --tags --abbrev=0) before building. On macOS and Unix-like systems the build is a Makefile, described as non-portable and requiring GNU-flavored make. Six make commands cover the whole path, and the last two are optional companions.
cd somewhere/my/projects/janet
make
make test
make repl
make install
make install-spork-git # optional
make install-jpm-git # optionalRun make test before you trust the binary, and make repl drops you into the REPL. From there the (doc apply) macro prints documentation for a core symbol, and (all-bindings) lists everything bound in the default environment, which is faster than paging through the API reference. If you want to try the language without installing it, the README points at Alpine Linux plus MUSL for a statically linked build, and shows a container that does the whole sequence:
docker run -it --rm alpine /bin/ash
$ apk add make gcc musl-dev git
$ git clone https://github.com/janet-lang/janet.git
$ cd janet
$ make -j10
$ make test
$ make install
$ make install-spork-git # optional
$ make install-jpm-git # optionalOne caveat the README raises in the same breath: a truly static binary under MUSL needs -static added to the Makefile flags by hand. The container gets you a working interpreter, not a finished static build.
Two install roots, and which one your scripts land in
The Makefile resolves its own paths from PREFIX, which defaults to /usr/local, and then derives several of them. One detail a skim misses: JANET_PATH defaults to $(LIBDIR)/janet while JANET_PKG_CONFIG_PATH defaults to $(LIBDIR)/pkgconfig. Two different subdirectories under the same library prefix, one holding Janet's own path data and one holding the pkg-config file. If you relocate the library prefix with LIBDIR, you move both.
The binary is build/janet, and the shared and static libraries are build/libjanet.so and build/libjanet.a, with import libraries build/janet.lib and build/libjanet.lib named alongside. CLIBS is set to -lm -lpthread. A port means making the Makefile work on your platform, and the repository layout shows how much porting is already done: there is a meson.build and meson_options.txt beside the Makefile, a plan9.mk for Plan 9, and a build_win.bat for Windows.
Package installation inherits the same prefix problem, and it is the first thing to check after an install. Spork scripts go to $JANET_PATH/bin/ on POSIX systems, which is not on the PATH out of the box, so add it yourself. JPM installs to /usr/local/bin/ instead, which may or may not be on your PATH either. Which of the two you installed decides which of these directories now holds your tools.
Spork and JPM split along a stability line
The two companion projects are not interchangeable, and the README draws the line by saying which one is changing. Spork is the current one: a collection of utility modules plus packaged scripts including janet-format for code formatting, janet-netrepl for a socket-based REPL, and janet-pm as the project manager. It needs a C compiler, because it builds extension components such as miniz and JSON utilities. Its stability is explicitly lower than core Janet's, though the stated intent is to add new modules and functions rather than break existing ones. Individual modules such as spork/path are independent and can be vendored by hand into your own project without installing the whole of Spork.
JPM is described as older and more opinionated, and it does not require a C compiler. The same paragraph that calls it less flexible also says it is not receiving many changes, that it may be harder to configure correctly on a new system, and that in that sense it may be more stable. Two of those statements pull in opposite directions, and the honest reading is that JPM is frozen in exchange for not moving under you. That is a reasonable trade for a build tool, and the README calls both Spork and JPM optional, especially in an embedding use case.
The PEG parsing engine in core is worth knowing about next to this. It is positioned as an alternative to regular expressions, and it lives in core rather than in either companion, so it does not carry Spork's stability caveat.
The master branch is where the work happens
Adoption signals for Janet are thin in a way that matters for a language you embed. The README names the GitHub repository as the official one, then says the SourceHut mirror is actively maintained, while also warning that most development happens directly on master and that master is not necessarily stable. Those three statements coexist without contradiction once you accept that the mirror receives the commits and the tag is what you build, but a reader who takes the mirror's activity as a sign that any given version is safe to ship will draw the wrong conclusion.
Judging from the tagged releases alone, upgrades are not a monthly chore: v1.42.1 shipped on 2026-09-11 and v1.42.0 on 2026-08-31, while the previous tag, v1.41.2, dates from 2026-02-18. Licence is MIT, which matters most for the embed case, since janet.c carries the notice and you can ship it inside a proprietary binary without a copyleft obligation.
The repository does carry is a CONTRIBUTING.md, a janet.1 man page, an examples directory holding life.janet, echoserve.janet, ffi/, jitfn/ and channel.janet among others, and continuous test builds wired to both forge mirrors.
Editorial conclusion
Adopt Janet when you need user scripting inside a C or C++ host, or a small scripting language for automation,. Do not adopt it if you need a large standard library, a stable package tool, or a language whose master branch is already known to be unstable. Before committing, build the newest tag, run make test on it, then diff the C API between the tags you plan to ship to see how often the core surface moves under an embedded copy.
Frequently asked questions
How do I build Janet from source on macOS or Linux?
Clone the repository, check out the newest version tag with git checkout $(git describe --tags --abbrev=0), then run make, make test and make install. The Makefile requires GNU-flavored make and is described as non-portable, and make help lists the available targets.
What is the difference between Spork and JPM in Janet?
Spork is the newer collection of utility modules and scripts, requires a C compiler to build, and installs its scripts to $JANET_PATH/bin/ on POSIX systems. JPM is older, needs no C compiler, installs to /usr/local/bin/, and the README says it is not receiving many changes and that in that sense it may be more stable.
How do I embed Janet in a C or C++ program?
The runtime is distributed as janet.c and janet.h, which is the C API route. Faster paths exist for prototypes: a built-in C FFI declares and calls C functions from a script without writing any C, and natives are C functions compiled ahead of time and dynamically loaded as plugins.
Can I try Janet without installing it on my system?
Yes, through a container on Alpine Linux with MUSL, which the README gives as a good combination for a statically linked build. Inside the container you add make, gcc, musl-dev and git, clone the repository, and run make, make test and make install. A truly static binary still needs -static added to the Makefile flags by hand.
Official sources
Where developers are discussing it
Posts on Hacker News, dev.to and Lobsters that link to this repository, found by our scan of those communities. 0 in the last 30 days; newest first.
- Janet 1.42.0Hacker News · Sep 10, 2026 · 1 points · 0 comments
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/janet-lang-janet)Star history chart for your README
[](https://hysenlabs.com/projects/janet-lang-janet)Was this useful?