[ANN] IX, a full OS (kernel, toolchain, vcs, ...) in OCaml

Hi,

It is my pleasure to announce IX, a full operating system written in OCaml (by Claude Code). It is a continuation of two of my past projects, principia softwarica and XiX.

IX is an ARM emulator, a kernel, a shell, C and ML compilers, an assembler and a linker, an editor, a build system, a database, version control, and more, each a separate program written in OCaml, small enough to read in a few sittings, following Plan 9. Each program comes in two sizes: mini, the Plan 9 original reimplemented faithfully, and tiny, a free variant in one file. mini is around 50 000 LOC while the tiny variant is 10 000 LOC. You read that right, a full OS, kernel, assembler, linker, database, etc in 10 000 LOC!

Repo: GitHub - aryx/IX: A complete computer system in small, readable OCaml programs: an ARM emulator, a kernel, a shell, C and ML compilers, an editor, version control and more. · GitHub

website: IX — A Whole Computer System in Small OCaml Programs

You can even explore the codebase with a nice visualizer, codemapv2 (itself a rewrite, using Claude, of two of my past projects, codemap and codegraph done while at Facebook): ix: code map
Some literate books explaining in detail the code will arrive soon.

The trend these days is to use AI to write more and more code, faster than anyone can read it, until only the AI can add a feature to the program. This was already partly true before AI: many programs had grown so big that they were very hard to change. IX uses AI the other way. Here it rewrites giant programs in far less code, until a whole system is small enough for a person to understand again, and to extend: by hand, or by asking the AI, but in a way that person can still follow. AI can help people take back control of the programs they use.

Enjoy!

This is really cool! I love the focus on simplicity. It is actually impressive that the code is so small given you used AI.

Does this use Ocaml 5 effects?

No, it does not use OCaml effects. Actually it mostly uses a subset of OCaml I call ocaml-light (haha, old camlers will get the joke) no functors, no classes (I actually made an explicit fork for it here: GitHub - aryx/ocaml-light: A fork of ocaml 1.07 without objects and without functors meant for education purposes · GitHub ). Regarding the small size, yes it’s impressive. But it helped a lot I think to have a good model to imitate, that is the C source code Plan 9 (amazing old OS) and some initial port in OCaml I made in my xix project and principia softwarica project.

And it can now bootstrap! OCaml 4.14 and gcc are used initially to compile IX but then the IX mini-cc and mini-ml compilers (and mini-asm and mini-ld) can be used to compile the whole of IX for arm and arm64! Next step, the windowing system (A port of Plan 9’s rio).