Wick 0.3: bits you can build with¶
6 October 2026 · Ships with Lantern 0.8.0
Our next game asks the player to build a processor, using the Intel 8080 as its target. Before building that game, Wick needs to describe what the player will manipulate: bits, eight-bit registers, and sixteen-bit addresses.
Wick 0.3 adds a focused set of tools for that work:
0xhexadecimal and0bbinary literals.- AND, OR, XOR, NOT, and logical shifts as checked
bit_*functions. u8andu16for explicit byte and word wrapping.hexandbinfor readable register and bus displays.
let a = 0xFF
let wide = a + 1
let carry = wide > 0xFF
a = u8(wide)
check(carry and hex(a, 2) == "00", "carry stays visible")
Why functions, and why checked values?¶
The language already has typed native calls. Reusing that mechanism keeps the
compiler small and avoids adding a new operator-precedence ladder. A call to
bit_and says what it does; a bad argument type is caught at compile time.
Wick still has one numeric type. Bit functions accept unsigned 32-bit integers,
which a double represents exactly. Fractions, negative bit operands, nonfinite
values, and shifts outside 0–31 produce a Wick runtime error. The VM checks
before casting or shifting in C++; host undefined behaviour is not a language
feature. Negative arithmetic is useful for registers, so u8(-1) is explicitly
255. Wrapping accepts only safe integers.
Formatting pads without truncating. hex(256, 2) is 100, so a too-wide value
cannot disappear behind a two-character label.
The evidence: Bit Lab¶
The release includes Bit Lab, a small interactive register/ALU workbench written in Wick. Change input bytes, toggle individual bits, switch ADD/AND/XOR, and inspect the result and flags. It also demonstrates a sixteen-bit program counter wrapping from FFFF to 0000.
This is the first language exercise for the planned game. It does not claim to emulate the whole CPU, its instruction timings, or a player's gate network. The game itself remains the next project.
Tests and the book¶
The standalone compiler/VM suite covers valid expressions, all 256 byte values, 64 Ki entries of memory, malformed literals, unsigned boundaries, invalid numeric inputs, formatting widths, and hot reload. It runs without SDL. The existing language, touch, package, and path-sandbox suites remain regression gates. See the release for the exact validation performed.
The book is now edition 0.3: its existing chapters explain records, and a new chapter works through bits, buses, register pairs, memory, and an adder. The LaTeX source remains canonical for both the web edition and PDF. The language reference has a complete contract for the new functions.
There are still no imports, nested containers, closures, or string indexing. Those features need evidence from the game. This release adds the operations we can already demonstrate needing.
Upgrade note: the new built-in names (bit_and, bit_or, bit_xor,
bit_not, bit_shl, bit_shr, u8, u16, hex, bin) reject same-named user function declarations at compile time. Rename a colliding function. No dependencies or numeric
types were added.