/\ /\ /\ /\ /\ / \ /\ / \ /\ / \ /\ / \ D E N V E R / \/ \/ \/ \/ \/ \/ \ https://akuma.sh/ _/ \_ Beans System Debauchery: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel for Clojure
Beans in Denver: Fresh Kernel from a Crate?
How to build a KVM kernel for Java, Clojure, Scala and Groovy with open source and open weights: 24 hour practical joke from early 2000s
Akuma
=#= .-
+*#*:.:-**
+%%#%##***
+%%%#%%#**.
+%@@@%%%+*:
:::::--=+++*%@%@%%%%*-
:-+##%%%%%%%%@%@#%%@%%%%##%+
.=##%%%%%%%%%@@@@@%#%%@%%%@@@%%-
.*%%%%%%%@%%%%@%@@@@%%%%@%%%%%@@#-
%@%%%%%%%%%%@%%%%%@@@%%%@@@@@%%%#+
*%%%%%@%@@%@@@%%%%#%@@@@@@@%%@@%@@@*+--
::=+*#@@@@@@@@@@@%%%%%%@%%@#----=**@%@#
.--+**%@@@@@%@@%%@@%* :-.
::::---#@%%*
Akuma is a bare-metal kernel written in Rust. It is Linux ABI-compatible, runs on aarch64 and amd64, and is released under the BSD 2-clause license.
Akuma runs on real hardware with real drivers. It serves as a basis for other, more experimental kernels that look at what open-weight models can do in open-source kernel development and systems programming. Akuma is a self-hosting kernel, which means it builds itself: rustc and cargo run on Akuma and compile Akuma's own source. Here is the talk presented at rust.org.il in November 2026.
It is built from small host-tested crates, and amd64 includes its own hypervisor, which is what Denver runs on.
Denver, the KVM guest kernel
/\ /\ /\ /\ /\ / \ /\ / \ /\ / \ /\ / \ D E N V E R / \/ \/ \/ \/ \/ \/ \ https://akuma.sh/ _/ \_ Beans System Debauchery: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel for Clojure
Denver is a Rust kernel that can run on bare metal via KVM. It reuses Akuma's crates to present a smaller surface still providing OS level isolation.
After finishing with a Rust crate for kernel that can run a specific platform, Tokio runtime, I remembered about all these fun languages that were released in 2000s after JVM got generics and fast reflection and other cool stuff, and tried to estimate how much code would it take to take akuma-tokio-kernel to the next level and build a new crate, akuma-jvm-kernel? My guess was 2-3k lines, not more than 5k. It took about 1750 lines of code to make it happen.
All the work was performed by GLM-5.3-Flash from z.ai mostly in autoresearch mode, methodology and runbooks are available on GitHub.
Autoresearch loop did require human intervention a couple of times but mostly to set up a test environment and to save tokens.
The whole experiment ran completely on Akuma kernel running on a Ryzen amd64 laptop with a goose agentic harness. Denver kernel builds were built with nigtly Rust and Cargo on Akuma and tested as KVM guests.
Some post-experiment cleanup was performed by Sonnet 5.5.
A Clojure web server on Denver
Why run Clojure on a Rust kernel?
Because it's beautiful and reminds me of the Fall 2007.
Source: denver/samples/clojure/server.clj.
(require 'clojure.string)
(import '(com.sun.net.httpserver HttpServer HttpHandler)
'(java.net InetSocketAddress))
(def hits (atom 0))
(defn json [m]
(str "{" (clojure.string/join "," (for [[k v] m] (str (pr-str (name k)) ":" (pr-str v)))) "}\n"))
(defn body []
(let [rt (Runtime/getRuntime)]
(json {:server (str "clojure " (clojure-version))
:hit (swap! hits inc)
:os (System/getProperty "os.version")
:vm (System/getProperty "java.vm.name")
:java (System/getProperty "java.version")
:arch (System/getProperty "os.arch")
:cpus (.availableProcessors rt)
:heap_mib (quot (.maxMemory rt) 1048576)})))
(def handler
(proxy [HttpHandler] []
(handle [ex]
(let [bytes (.getBytes ^String (body) "UTF-8")]
(.add (.getResponseHeaders ex) "Content-Type" "application/json")
(.sendResponseHeaders ex 200 (count bytes))
(with-open [out (.getResponseBody ex)]
(.write out bytes))))))
(doto (HttpServer/create (InetSocketAddress. 8080) 0)
(.createContext "/" handler)
(.start))
(println "listening on :8080")
(flush)
@(promise)
Why run Scala on a Rust kernel?
Sometimes you just need more types.
The same server in Scala 2.13, on the same JDK's HTTP server: a lambda is the handler, string interpolation builds the JSON. Source: denver/samples/scala/Server.scala.
import com.sun.net.httpserver.{HttpExchange, HttpServer}
import java.net.InetSocketAddress
object Server extends App {
var hits = 0
def json(fields: Seq[(String, Any)]): String =
fields.map {
case (k, v: String) => s""""$k":"$v""""
case (k, v) => s""""$k":$v"""
}.mkString("{", ",", "}\n")
def body: String = {
hits += 1
val rt = Runtime.getRuntime
json(Seq(
"server" -> s"scala ${scala.util.Properties.versionNumberString}",
"hit" -> hits,
"os" -> sys.props("os.version"),
"vm" -> sys.props("java.vm.name"),
"java" -> sys.props("java.version"),
"arch" -> sys.props("os.arch"),
"cpus" -> rt.availableProcessors,
"heap_mib" -> rt.maxMemory / 1048576))
}
val server = HttpServer.create(new InetSocketAddress(8080), 0)
server.createContext("/", (ex: HttpExchange) => {
val bytes = body.getBytes("UTF-8")
ex.getResponseHeaders.add("Content-Type", "application/json")
ex.sendResponseHeaders(200, bytes.length)
ex.getResponseBody.write(bytes)
ex.close()
})
server.start()
println("listening on :8080")
}
A kernel is a manifest
Denver adds almost no kernel code of its own. One binary crate and one front crate choose, by feature name, which existing crates make up the kernel. Every feature is off by default, so the default build never changes.
denver the binary: main.rs, banner, the feature list
| features, 1:1
akuma-jvm-kernel front crate: entry!, Kernel, zero capabilities
| features, 1:1
akuma-tokio-kernel the platform: tokio on bare metal
|
'-- akuma-tokio-kernel-amd64 machine half: the arms the features turn on
'-- runtime-tokio, syscalls-glue, exec, mmu, pmm, vfs, net, tty ...
Stats
javac compiles inside the guest and its output is identical to the host's. Clojure, Scala and Groovy compile and run. A Clojure HTTP server answers from outside, from a fresh kernel under KVM on metal.
The workload is the spec
- Run the thing you want on your best system first. Where it fails is your gap list.
- Rank gaps by the workload's own order of operations, never by taste.
- Suspects stay hypotheses until something that reaches them dies naming one.
- Evidence comes from captured logs, never from memory.
The instrument is part of the experiment
- A verdict can lie: buffering, wrong constants, parsing by position.
- Disassemble a surprising probe before blaming the kernel.
Case in point: a probe reported that rt_sigreturn lost a register. The kernel was right. The committed probe binary stored its edit in the wrong slot, because it did not match its own source.
Compose, then loop
- Front crate is a pure pass-through.
- One feature per measured gap, relayed 1:1, off by default.
- Call existing crates; never fork them.
- One gate per session, captured output is the only judge.
- Cheap cycles, honest failures, records before polish.
- The human stays in the loop.
Interrupt, then look for the flag
- The first path found is not the path required.
- Ask "can we go around?" before chasing. A well-aimed interruption is the cheapest tool in the box.
- "Not implemented" is a configuration question before it is an implementation task.
- The HTTP server needed one line in a manifest:
shell = ["akuma-jvm-kernel/shell"].
Reproduce it locally
You need Rust (nightly toolchain from the repo), QEMU and Docker. No KVM needed: QEMU runs the x86 guest under TCG, which is slow but takes about 15 seconds to answer. ARCH=aarch64 runs the same on the aarch64 kernel under QEMU with HVF (fast on an Apple Silicon Mac).
git clone https://github.com/netoneko/akuma && cd akuma
overlays/denver/build-kernel.sh # the gate feature set -> out/denver
overlays/denver/build-image.sh # JDK 21 + Clojure 1.12 -> out/denver-clojure.img
overlays/denver/run.sh # boots; the guest's init is java itself
curl http://localhost:8080/ # {"server":"clojure 1.12.0","hit":1,"os":"0.1.0-...-denver", ...}
The records
- denver/README.md: the lessons in full
- the plan and the core idea
- the experiment log
- the methodology: six lessons on requirements, probes, the loop
- the runbook: how to run the loop yourself
- the eight defects
/\ /\ /\ /\ /\ / \ /\ / \ /\ / \ /\ / \ / \/ \/ \/ \/ \/ \/ \ _/ \_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~