projects
Featured projects
Tools written in Jennifer and used for real work. Each one is plain .j source you can read, run and fork.
-
grimoire.jennifer-lang.dev
Grimoire
Build a documentation site - and a printable PDF or an EPUB - from a directory of Markdown.
What mdBook and MkDocs do, written in Jennifer. Point it at a directory of Markdown: a
SUMMARY.mdbecomes the outline, or the directory tree does. The result is a self-contained static site - themed, searchable, with a dark mode - that works from a web root, a subdirectory or straight off the disk. Jennifer's own documentation is built with it.- Ten themes, each with a light and a dark palette
- Full-text search that works over file://
- A printable PDF and an EPUB of the whole book
- Interface words in English and ten more languages
grimoire init my-book grimoire build --pdf grimoire serve
-
jsnake tick 122 5 player(s) hosting udp:47475 public ┌──────────────────────────────────────────────────────────────────────────────┐ │ * ** @ │ │ %%%%* * * * │ │ %%%% │ │ V %% * * │ │ %%% │ │ % %% * │ │ % * │ │ @ C OOOOOO │ │ @ O O * │ │ +++ O @ @XX │ │ + OOO X │ │ + + XX │ │ ! +++ ++ XXXXXX│ │ ++++ * │ └──────────────────────────────────────────────────────────────────────────────┘ > O ada 50 len 14 ♥2 alive X cpu1-normal 40 len 12 ♥2 alive *# cpu2-normal 90 len 4 ♥2 alive % cpu3-normal 70 len 18 ♥3 alive + cpu4-normal 60 len 16 ♥3 alive arrows / wasd steer esc menu ^C quit * food C candy +3 V veg -3 ! toadstool! G ghost
github.com/jennifer-language/demo-jsnake
jsnake
Multiplayer snake for the Linux console - over TCP or UDP, with nobody typing an address.
Players find each other by UDP broadcast; the game itself runs over either TCP or UDP, and empty seats fill with computer players at four levels, from
easytoexpert. The field sizes itself to the smallest terminal at the table, the host changes the settings on a title screen while players arrive, and Escape is the only key besides the arrows.- Up to eight players, on one network
- Computer opponents at four skill levels
- Candy, vegetables, a toadstool and a ghost spell
- A plain-text protocol - every decoder is total
jvc app install \ https://github.com/jennifer-language/demo-jsnake jsnake solo jsnake host --bots 3
-
cantrip.jennifer-lang.dev
Cantrip
Turn a Markdown file into a self-contained HTML slideshow - and a PDF.
The input is ordinary Markdown: slides separated by a line of three dashes, front matter at the top, speaker notes in HTML comments - so a deck still reads as a document and diffs like prose. The slideshow is one file with nothing fetched at view time, so it works on a conference laptop with no connection. The PDF is one page per slide at the deck's own ratio, and stays white for a legible handout whatever the theme.
- 13 themes, each light and dark, including all of Grimoire's
- Keyboard navigation, an overview and presenter notes
- Three ratios and four slide transitions
- No network, exec or sql - it runs on jennifer-tiny too
jvc app install \ https://github.com/jennifer-language/cantrip cantrip build talk.md
-
loaded json checkpoint <- 32k1000.json (vocab 27, 1328 params) --- sampled names (temperature 0.5) --- sample 1: dareen sample 2: elina sample 3: arin sample 4: stalel sample 5: avange sample 6: syay sample 7: rani sample 8: aeri
github.com/jennifer-language/demo-microgpt
microGPT
A GPT written from scratch - attention, training and sampling - on a scalar autodiff engine.
A port of Andrej Karpathy's microGPT: a character-level transformer with the shape of GPT-2 that learns to invent names. Every number in it is a node on one tape, differentiated by the engine from demo-micrograd, which builds it in eight editions you read as diffs. Training runs across every core with
spawn, each worker on its own copy of the tape, and a trained model is saved as a checkpoint to sample from later.- Multi-head causal attention, an MLP, RMSNorm and Adam
- 1328 parameters, trained on 32,033 names
- Data-parallel training, safe by value semantics
- Checkpoints in JSON or plain text
git clone \ https://github.com/jennifer-language/demo-microgpt cd demo-microgpt jennifer run sample.j --load 32k1000.json
-
$ distributed submit wordcount -f input=data/web.txt.gz -o top=5 --wait j1 j1 Queued: 0/8 tasks, 0% of 4988246 bytes, 0 words j1 Running: 12/24 tasks, 15% of 4988246 bytes, 147727 words j1 Running: 19/27 tasks, 52% of 4988246 bytes, 488058 words j1 Running: 25/27 tasks, 78% of 4988246 bytes, 730463 words { "bytes": 4988246, "lines": 42234, "words": 925038, "distinct": 15036,github.com/jennifer-language/demo-distributed
distributed
Distributed computing on your own machines - a master, workers that find it on the network, and jobs cut into tasks.
A master schedules prioritised jobs; workers discover it by UDP broadcast, pull tasks for the queues they serve and send the results back, and the master combines them. Jobs of equal priority share the slots, tasks are sized by measurement to about two seconds each, a lost task is leased again, and the master keeps its state across restarts. A new kind of computation is one file of six functions; four come with it: word counts, digits of pi, sleep and running programs.
- Discovery by UDP broadcast, no address to type
- Leases, heartbeats and retries for lost workers
- Snapshots: a restarted master carries on
- A live terminal screen of jobs and nodes
git clone \ https://github.com/jennifer-language/demo-distributed cd demo-distributed ./bin/distributed master ./bin/distributed worker --slots 2
-
$ jennifer run tasks/Roman_numerals__Encode/solution.j 1990 MCMXC 2008 MMVIII 1666 MDCLXVI 4 IV 3999 MMMCMXCIX
github.com/jennifer-language/rosetta
Rosetta Code
Jennifer solutions to Rosetta Code tasks - each one run and checked again on every release.
Rosetta Code solves the same programming tasks in hundreds of languages, side by side. This repository is the master copy of the Jennifer solutions: 51 tasks so far, from FizzBuzz to the N-queens problem and a Mandelbrot set. Each one is formatted, linted, run and compared with its expected output before it goes on the wiki, and again on every release and every week against the interpreter's
mainbranch, so a solution never goes stale unnoticed.- 51 tasks, two of them over the network
- Checked on the release and on main, weekly
- MIT-0: copy a solution anywhere
- One script prints a task's wiki section
git clone \ https://github.com/jennifer-language/rosetta cd rosetta tools/check.sh FizzBuzz
Built something in Jennifer?
A tool people use, written in the language - tell us about it and it may be featured here.