Jaylib-WASM provides a Makefile/emscripten based compile process to build a good number of the Raylib v6 examples in Janet, running on the web via WASM.
The demo page has a list of the examples ported so far.
There is also a command line tool that lets you run the same web page Janet code via a command line (only in Linux so far).
Note: This effort is a personal exploration, not an official Janet effort. AI use in Janet core code needs to be heavily reviewed before use.
Jaylib-WASM is an experiment for me using DeepSeek to help me quite a lot to build these examples. It has worked relatively well for me so far.
I have an interest in Common Lisp. I got steered towards Janet via Ian the Henry's site and his Janet for Mortals book.
I'm interested in getting Raylib working on web pages and wondered about bending Jaylib a bit this way...
Janet devs have already got Janet and Raylib working in WASM already. Jaylib-WASM uses Jaylib (currently supporting Raylib v5) and Raylib v6 and gets about 65 of the Raylib v6 Examples running on a web page.
The "main loop" concept that Raylib usually uses doesn't work as easily on a web page, so this project uses (suggested by DeepSeek) an update function, similar to Love for Lua), to do updates while not "owning" the loop.
Once the update function is created, the end of the Janet file simply initialises the window and runs the loop.
(init-window screen-w screen-h "Post-processing Shaders")
(set-target-fps 60)
(run-game-loop update)
Why build this?
It's been fascinating to see how much pretty good code an Agentic AI tool can create relatively quickly. It make mistakes, but these can be caught in the process. Keeping a good set of tests would help automate this too.
Doing this little project DeepSeek has been quite affordable and effective for me. Using DeepSeek in this way is possibly not an option that businesses would use. The code is getting completely understood and altered by DeepSeek.
With all of that said, It's great to be able to put a running demo of an idea up on a web page. All of the Raylib demos do this. Writing the demo in a lisp family tool makes a touch more pleasant and more powerful (macros, REPL, etc).
Why Use Janet?
Janet is an interesting LISP-like language. It's made some interesting decisions with fibers for concurrency and more efficient Parsing Expression Grammars (PEGs), rather than regular expressions.
So far, Janet has felt comfortable as a tool to quickly throw little tools together.


Top comments (0)