Ice

Ice is a small, dynamically typed scripting language and tree-walking interpreter written from scratch in C for Rime. It borrows the familiar surface of JavaScript, with first-class functions, closures, arrays, and objects, while shedding the historical quirks and runtime weight that come with a browser engine.

Writing an operating system in C and assembly forces you to care about every byte and every pointer. Eventually, though, you want a way to glue pieces together without a compiler in the loop: to inspect system state, transform a file, pull something over the network, or test an idea in the space of an evening. Porting an existing engine like Lua or QuickJS would have solved the practical problem in an afternoon, and missed the point entirely. Just like Rime, Ice was built so that there are no black boxes. In just under ten thousand lines of C, from the lexer and parser down to the garbage collector and the system call boundary, the entire runtime is small enough for one person to hold in their head.

Under the hood: tree-walking AST interpreter over a single flat node representation, zero-copy lexer token slices, gray-list mark-and-sweep garbage collector tracing both values and lexical environment chains, first-class closures and bound receiver methods, non-fallthrough switch, key/value foreach, double-quoted string interpolation, background HTTP worker handles, gated shell execution, and native bindings to Rime's VFS, system settings, notices, crypto, and GUI color primitives.

If you can read C or JavaScript, you already know how to read Ice, though a few rough edges have been smoothed down along the way. Bindings are declared with var or const. switch statements don't fall through. foreach walks array elements or an object's key-value pairs directly without ceremony. Double-quoted strings expand "{expr}" segments inline, while single-quoted strings stay strictly literal so you never have to guess what a string is doing. Common tools that usually require hunting around, like range(), format(), assert(), logical assignments like ||=, and functional array methods like map, filter, and reduce, are simply there when you reach for them.

var profile = { name: "Ada", born: 1815, tags: ["math", "code"] };
foreach (var key, var value in profile) {
    print("{key}: {value}");
}

var squares = range(1, 6).map(function(n) { return n * n; });
print("sum =", squares.reduce(function(a, b) { return a + b; }));

Because Ice grew up inside Rime's userland rather than as a portable, lowest-common-denominator library, it speaks the operating system's native language. Arrays and objects are backed directly by Rime's standard data structures. Cryptographic digests (sha256, sha512, md5, crc32), Base64, JSON, and XML round-trip in a single call through Rime's shared system libraries. Colors are the same 0xRRGGBB numbers the window server uses, complete with built-in helpers to blend, lighten, or convert them to HSV. A script can ask the kernel for memory stats and running tasks with systemInfo(), read and write persistent OS preferences, post desktop notices, or fire off asynchronous HTTP requests and wait on their handles when ready. Shared libraries live cleanly under /Developer/Ice (or along ICEPATH) and load relative to the caller with a simple include().

Even in a hobby system, limits need to stay deliberate. Recursion, call stacks, and nested includes all have explicit depth guards, and while Ice can read its environment and work with the filesystem, it won't quietly spawn subprocesses behind your back: calling system() or systemCapture() is refused unless you explicitly pass --allow-shell before the script name. Nothing runs unless it was asked to.

Ice is a simple, capable little tool made to fit the hand that built the machine underneath it.

Written by främling on Nov 15, 2026.

Text may be shared, with credit, and not for commercial use (CC BY-NC-SA).