Moving to Roc 0.1.0 RC1
Seven projects, about 144,000 lines of Roc, all checks green at RC1.
Each project's previous pin, nightly-2026-11-03-34bd006, against RC1:
| project | lines of Roc | dev build after an edit, CPU s | cold check, CPU s | RC1 checks |
|---|---|---|---|---|
| roc-apps | 78,143 | 5.24 → 0.61 (8.6× faster) | 6.83 → 4.55 (1.5× faster) | green: 51 apps, Safari's and four other gates |
| roc-chat | 45,278 | 8.48 → 1.42 (6.0× faster) | 7.71 → 8.08 (about the same) | green: 29 checks, the end to end and cost check among them |
| roc-screensaver | 8,904 | 1.28 → 0.15 (8.5× faster) | 1.74 → 1.83 (about the same) | green: 34 checks, frames pixel-identical |
| roc-markdown | 6,413 | 0.52 → 0.07 (7.4× faster) | 0.56 → 1.33 (2.4× slower) | green: its gates |
| roc-syntax-color | 5,329 | 1.06 → 0.05 (21.2× faster) | 0.55 → 1.34 (2.4× slower) | green: its gates |
| roc-types | 76 | a Zig program; its Roc is test fixtures | rebuilt, tested, published | |
| roc-ast | 7 | a Zig program; its Roc is test fixtures | rebuilt, tested, published | |
A report for the Roc team on 0.1.0_RC1. Claude, an AI coding agent, made the moves, ran the measurements and wrote this page under Steve's supervision.
Summary
Possible issues for the Roc team
- Dev builds default to boxy lowering (every
roc buildbut--opt=speed). KnightProof ran 22 times slower built with--opt=dev: 344.7 s of CPU, against 15.6 s on the old nightly; 15.8 s with--specialize=yes, which our chess gate now passes. Read more below. - A "duplicate definition" warning we're unsure is intended, for a nested type's member named like
the outer type's (
Crate.width,Crate.Lid.width). The program runs correctly. roc-chat's five such renames: e8e8a84. Read more below. - Cold checks took about 2.4 times the CPU in roc-syntax-color and roc-markdown (under 1.5 s each); the same in roc-screensaver and roc-chat, less in roc-apps. Read more below.
- Release outputs are 8 to 13% bigger. Read more below.
Things we simply had to fix in our own code
- The shadowing warning, now reaching a type's own members: 83 renames. Read more below.
- Unsuffixed literals whose only constraints are method calls (
(0.0).to_bits()): 14 given a type. Read more below. - The nominal check caught Safari passing a plain record where
CatandBirdwere wanted. Read more below. - Glue:
on_copyandcapture_sizein the erased callable's payload, newRocOpaqueListandRocHeldList; regenerated, seam checks green. Read more below. - Native roc-ray builds retired: roc-ray hasn't moved to RC1 yet (15 nominal errors in our checkout). Read more below.
What moving cost us
- 83 renames (31 roc-apps, 48 roc-chat, 4 roc-screensaver): shadowing. Our gates fail on any warning.
- 5 nested-member renames in roc-chat, 51 call sites: duplicate definition.
- 14 typed literals (5 roc-apps, 9 roc-screensaver): literals.
- Safari's Cat and Bird built as nominal values: nominal check.
- Glue regenerated in book_builder, roc-chat and roc-screensaver; roc-types passes
BuildEnv.init's new specialization-strategy argument: glue. --specialize=yesin the chess gate: boxy default.- Native roc-ray builds retired. Steve: "we have had successful roc-ray builds in the past but stopped verifying native builds after some compiler churn". roc-ray isn't ours to move.
- roc-types' release build stripped, past an LLVM assertion in our patched Zig 0.17.1. Not Roc's.
Much of this was our own code being wrong: parameters hiding their function (our Safari book taught
metres = |metres|) and a plain record standing in for a nominal type.
By repository
| repository | what the move took | commits |
|---|---|---|
| roc-apps | 31 renames, the nominal Cat and Bird, 5 typed literals, the chess gate's flag, the glue, and the native builds retired. The workaround for the crash that roc#12925 fixed was already gone. | 6784d48, 3f7dd21, b61317a, 4b4a9d3, 862e380, a44c405, 5dca699, 74fc1f9 |
| roc-chat | 48 renames, made at the old pin and checked at RC1 too (no errors; only the five warnings below). Then the five nested-member renames, exact pin checks in the build, verify and glue, the pin and the glue; its 29 checks are green. | d56daed, e8e8a84, ef7b89e, c8c532c |
| roc-screensaver | 4 renames, 9 typed literals and the glue. Its rendered frames are pixel-identical: the PNG harness's checksums didn't change. | 29774b1, a14102b, 0940319 |
| roc-markdown | The pin only; its gates are green. | f3bc41a |
| roc-syntax-color | The pin only; its gates are green. | 5ba4459 |
| roc-types | Rebuilt against 15177e9 and published as roc-types-1-0.1.0_RC1, passing the new specialization strategy and stripping its release build. | 6d522d3, 8e7a5e7, ec68d81, 879e1f8 |
| roc-ast | Rebuilt against 15177e9 and published as roc-ast-flat1-0.1.0_RC1. | 6ef6c45, 0d054a2 |
Dev builds default to boxy lowering
roc build --help: "Use lambda-set specialization (yes, the --opt=speed default) or boxy lowering (no,
the default otherwise)". Safari's dev-built proof tools took 56 s either way; KnightProof's search (CPU s, one run):
| build | old nightly (2026-11-03) | RC1 |
|---|---|---|
--opt=dev | 15.60 s | 344.73 s |
--opt=dev --specialize=yes | n/a | 15.82 s |
--opt=speed | 0.92 s | 0.33 s |
With the flag the chess gate went from 593 s to 24.7 s. Our workaround:
roc-apps canvas_apps/chess_kit/gates/run.shale, lines 44-49, at a44c405
-- `--specialize=yes` because Roc 0.1.0_RC1 lowers a dev build the boxy way
-- unless told otherwise, and KnightProof's search ran 22 times slower so: 344.7 s
-- of CPU, against 15.8 s specialized (15.6 s at nightly-2026-11-03-34bd006).
function hold_proof(roc, toy, work)
local bin = real(work) .. "/" .. toy.proof
local b = run({roc, "build", "--opt=dev", "--specialize=yes", toy.proof .. ".roc", "--output=" .. bin}, {cwd = toy.folder, timeout_ms = 600000, tail = 40, nice = 19, want = WANT})
"Duplicate definition" for a nested type's member
A bare width inside Lid would mean the inner one, so this may be intended. But the two are
only reached qualified, and if it is intended, a message other than "duplicate definition" would help.
Crate.roc
Crate := { width : U64 }.{
width : Crate -> U64
width = |Crate.(crate)| crate.width
Lid := { width : U64 }.{
width : Crate.Lid -> U64
width = |Crate.Lid.(lid)| lid.width
}
}
main.roc
app [main!] {}
import Crate
main! = |_args| {
echo!("${Crate.width(Crate.({ width: 3 })).to_str()} ${Crate.Lid.width(Crate.Lid.({ width: 4 })).to_str()}")
Ok({})
}
roc check main.roc, at 0.1.0_RC1
── ● duplicate definition ────────────────────────────────────── ./Crate.roc:7:3
The name width is being redeclared here.
width = |Crate.Lid.(lid)| lid.width
^^^^^
In this scope, width was already defined in ./Crate.roc:3:2.
width = |Crate.(crate)| crate.width
^^^^^
── 0 errors and 1 warning ───────────────────────────────────────────── main.roc
RC1 runs it correctly (3 4); the old nightly checks it clean. roc-chat's five sites
(AgentKey.Admitted.scope; signed_bytes in GitHubSignUp.Claim,
GitHubState.Claim and Session.Claim; Users.Human.user) became
granted_scope, bytes_to_verify and as_user, 51 call sites in one commit,
e8e8a84.
The stricter nominal-type check
The old nightly let a plain record unify with a nominal type through an alias's parameter, and printed
Sit:
Cat.roc
Cat := { pose : [Sit, Run] }.{
pose_of : Cat -> [Sit, Run]
pose_of = |c| c.pose
}
main.roc
app [main!] {}
import Cat
Wrapped(kind) : { animal : kind }
wrap : pose -> Wrapped({ pose : pose })
wrap = |pose| { animal: { pose } }
cat : [Sit, Run] -> Wrapped(Cat)
cat = |pose| wrap(pose)
main! = |args| {
pose = if (args.len() > 1) Run else Sit
echo!(Str.inspect(cat(pose).animal.pose_of()))
Ok({})
}
roc check main.roc, at 0.1.0_RC1
── ✗ type mismatch ────────────────────────────────────────────── main.roc:11:14
This expression is used in an unexpected way.
cat = |pose| wrap(pose)
^^^^^^^^^^
It has the type:
Wrapped({ pose: [Run, Sit] })
But the annotation says it should be:
Wrapped(Cat)
A plain record is never the same as a nominal type like Cat, even when it has
exactly its fields.
Hint: To use Cat here, write Cat instead of the record type in the type
annotation that says it's a plain record. You can also convert between Cat and
a plain record with Cat.{ ... }: build a value of type Cat from a record's
fields, or take one apart and build a record from its fields.
── 1 error and 0 warnings ───────────────────────────────────────────── main.roc
Safari did this with Cat and Bird (both :=). The fix passes in what the pose
makes:
roc-apps canvas_apps/safari/Animation.roc, lines 52-57, at 4b4a9d3
placed_instant : Animation.Instant(pose), ({ pose : pose } -> kind) -> Geometry.Placed(kind)
placed_instant = |{ pose, location }, animal_of| {
road_point: location.road_point,
lift: location.lift,
kind: animal_of({ pose: pose }),
}
roc-apps canvas_apps/safari/EncounterPoses.roc, lines 52-71, trimmed, at 4b4a9d3
animal_of: |posed| Cat.(posed),
...
animal_of: |posed| Bird.(posed),
The same check finds 15 mismatches in our checkout of roc-ray's
platform (a plain record for Math.Vec2 or Camera.Settings) and 6 in our native runner on it.
roc-ray hasn't moved to RC1 yet, so we retired our native builds.
The shadowing warning
It now covers a type's own members. The old nightly checks this clean:
Distance.roc
Distance :: F64.{
metres : F64 -> Distance
metres = |metres| Distance.(metres)
to_metres : Distance -> F64
to_metres = |Distance.(amount)| amount
}
main.roc
app [main!] {}
import Distance
main! = |_args| {
echo!(Distance.metres(2.0).to_metres().to_str())
Ok({})
}
roc check main.roc, at 0.1.0_RC1
── ● duplicate definition ────────────────────────────────── ./Distance.roc:3:12
The name metres is being redeclared here.
metres = |metres| Distance.(metres)
^^^^^^
In this scope, metres was already defined in ./Distance.roc:3:2.
metres = |metres| Distance.(metres)
^^^^^^
── 0 errors and 1 warning ───────────────────────────────────────────── main.roc
83 in our code, mostly a getter's name reused for its constructor's parameter. Safari's book example, before and after:
roc-apps canvas_apps/safari/Distance.roc, lines 8-9, at 6784d48
metres : F64 -> Distance
metres = |metres| Distance.(metres)
roc-apps canvas_apps/safari/Distance.roc, lines 8-9, at b61317a
metres : F64 -> Distance
metres = |amount| Distance.(amount)
Unsuffixed literals and method calls
The old nightly checks this clean and prints 0:
main.roc
app [main!] {}
main! = |_args| {
echo!((0.0).to_bits().to_str())
Ok({})
}
roc check main.roc, at 0.1.0_RC1
── ✗ missing method ─────────────────────────────────────────────── main.roc:4:9
This number's type never resolved to a concrete type, so it has no to_bits
method.
echo!((0.0).to_bits().to_str())
^^^
Its type needs all of these:
a where [a.to_bits : a -> b, b.to_str : b -> Str]
Giving the number a suffix, using it somewhere that requires a specific type,
or annotating it will give it one.
── 1 error and 0 warnings ───────────────────────────────────────────── main.roc
A suffix fixes it, on both compilers. So did var $n = 0.U64 where only a later $n.max(...)
typed it:
roc-screensaver screensavers/lanterns/JetFlyBy.roc, lines 325-326, at a14102b
width = xs.fold(-1.0e9.F64, |a, x| a.max(x)) - xs.fold(1.0e9.F64, |a, x| a.min(x))
height = ys.fold(-1.0e9.F64, |a, y| a.max(y)) - ys.fold(1.0e9.F64, |a, y| a.min(y))
Glue changes
Two new payload fields:
roc-screensaver host/glue/platform_abi.zig, lines 81-86, at 0940319
pub const RocErasedCallablePayload = extern struct {
callable_fn_ptr: RocErasedCallableFn,
on_drop: ?RocErasedCallableOnDrop,
on_copy: ?*const fn (?[*]u8, isize) callconv(.c) void = null,
capture_size: usize = 0,
};
Two new list types:
roc-screensaver host/glue/platform_abi.zig, lines 573-606, trimmed, at 0940319
pub const RocOpaqueList = extern struct {
elements_ptr: ?*anyopaque,
length: usize,
capacity_or_alloc_ptr: usize,
...
pub fn RocHeldList(comptime T: type) type {
return extern struct {
elements_ptr: ?[*]T,
length: usize,
capacity_or_alloc_ptr: usize,
No hand-written host code of ours uses them; regenerating was enough, and book_builder's, roc-chat's and
roc-screensaver's seam checks pass. roc-types passes .boxy to BuildEnv.init's new seventh parameter; it lowers
nothing.
Build times
Five repositories, both compilers, under the announcement's four conditions: cold (cache emptied, then a hello-world built), warm (again at once), root changed and import changed (a comment appended to the root, or to the most-imported module). Median of three, seconds; the compilers alternated, each run niced with its own cache. The script; the TSV, with every run and the box's load.
Noisy (the box): roc-syntax-color's cold checks took 0.58, 7.44 and 9.47 s (old) and 10.64, 21.30 and 22.32 s (RC1) of wall time for about 0.5 and 1.3 s of CPU, and we don't know where the rest goes. roc-screensaver's release builds had outliers of 115.5 s (RC1) and 63 to 86 s (old). Trust a difference under 2 times only when the CPU agrees.
- Cold checks: about 2.4 times the CPU in roc-syntax-color and roc-markdown, the same in roc-screensaver and roc-chat, less in roc-apps.
- Warm: 10 to 64 times faster; roc-markdown's check 3 times (under 0.1 s), roc-chat's 1.8 and its dev build 6.2, roc-screensaver's test over 100.
- Root changed: mostly 4 to 32 times faster (roc-screensaver's test 75, roc-chat's 107). roc-markdown's check 0.07 → 0.04 s; roc-syntax-color's 0.12 → 0.20 s wall but 0.05 → 0.02 s CPU; roc-chat's 0.38 → 0.69 s CPU, slower. Import changed: the same to 11 times faster.
- Cold dev builds: the same, faster in roc-apps and roc-chat. Cold tests: mixed. Release builds: the same in roc-markdown, faster in roc-screensaver and roc-apps.
- Release outputs 8 to 13% bigger. Dev outputs bigger in three (roc-syntax-color's 2.3 times, cause unknown), smaller in roc-chat (0.7 times) and roc-apps (half, the one wasm dev build).
roc-apps (Safari)
| step | condition | wall, old | wall, RC1 | CPU, old | CPU, RC1 |
|---|---|---|---|---|---|
| roc check | cold | 5.81 | 3.62 | 6.83 | 4.55 |
| warm | 2.29 | 0.08 | 2.40 | 0.08 | |
| root changed | 1.64 | 0.42 | 2.26 | 0.44 | |
| import changed | 2.05 | 0.86 | 2.97 | 1.17 | |
| build, dev | cold | 8.97 | 5.82 | 8.54 | 6.58 |
| warm | 2.22 | 0.19 | 2.94 | 0.18 | |
| root changed | 4.62 | 0.61 | 5.24 | 0.61 | |
| import changed | 5.44 | 1.06 | 5.78 | 1.18 | |
| build, speed | cold | 81.92 | 27.44 | 59.90 | 28.23 |
| warm | 40.95 | 28.93 | 40.82 | 25.81 | |
| root changed | 44.25 | 32.80 | 45.42 | 29.61 | |
| import changed | 52.71 | 30.99 | 49.68 | 29.53 | |
| roc test | cold | 7.20 | 3.30 | 9.32 | 4.29 |
| warm | 2.68 | 0.07 | 3.37 | 0.08 | |
| root changed | 2.89 | 0.09 | 3.40 | 0.09 | |
| import changed | 4.54 | 0.56 | 6.13 | 0.77 |
roc-chat
| step | condition | wall, old | wall, RC1 | CPU, old | CPU, RC1 |
|---|---|---|---|---|---|
| roc check | cold | 5.42 | 5.36 | 7.71 | 8.08 |
| warm | 0.25 | 0.13 | 0.27 | 0.15 | |
| root changed | 0.34 | 0.65 | 0.38 | 0.69 | |
| import changed | 1.59 | 1.55 | 2.28 | 2.10 | |
| build, dev | cold | 15.25 | 7.38 | 21.67 | 10.83 |
| warm | 5.80 | 1.21 | 7.95 | 1.28 | |
| root changed | 6.38 | 1.34 | 8.48 | 1.42 | |
| import changed | 7.34 | 2.77 | 10.27 | 3.48 | |
| roc test | cold | 27.02 | 11.45 | 38.12 | 17.88 |
| warm | 13.35 | 0.23 | 19.17 | 0.21 | |
| root changed | 12.48 | 0.15 | 18.20 | 0.17 | |
| import changed | 14.17 | 3.49 | 20.13 | 4.89 |
roc-screensaver
| step | condition | wall, old | wall, RC1 | CPU, old | CPU, RC1 |
|---|---|---|---|---|---|
| roc check | cold | 1.28 | 1.48 | 1.74 | 1.83 |
| warm | 0.73 | 0.03 | 0.95 | 0.03 | |
| root changed | 0.79 | 0.03 | 1.00 | 0.03 | |
| import changed | 0.82 | 0.19 | 1.07 | 0.24 | |
| build, dev | cold | 2.13 | 1.96 | 2.93 | 2.25 |
| warm | 1.03 | 0.10 | 1.23 | 0.09 | |
| root changed | 1.08 | 0.15 | 1.28 | 0.15 | |
| import changed | 2.06 | 0.30 | 2.47 | 0.33 | |
| build, speed | cold | 31.20 | 17.67 | 26.01 | 19.87 |
| warm | 38.13 | 17.44 | 22.26 | 18.11 | |
| root changed | 31.33 | 21.80 | 25.80 | 18.95 | |
| import changed | 22.26 | 18.42 | 22.57 | 20.67 | |
| roc test | cold | 4.04 | 2.14 | 4.76 | 2.38 |
| warm | 2.33 | 0.02 | 2.47 | 0.02 | |
| root changed | 2.24 | 0.03 | 2.48 | 0.03 | |
| import changed | 2.34 | 0.70 | 2.73 | 0.69 |
roc-markdown
| step | condition | wall, old | wall, RC1 | CPU, old | CPU, RC1 |
|---|---|---|---|---|---|
| roc check | cold | 0.70 | 1.67 | 0.56 | 1.33 |
| warm | 0.06 | 0.02 | 0.04 | 0.02 | |
| root changed | 0.07 | 0.04 | 0.05 | 0.03 | |
| import changed | 0.30 | 0.17 | 0.26 | 0.17 | |
| build, dev | cold | 1.39 | 1.41 | 1.29 | 1.27 |
| warm | 0.55 | 0.05 | 0.51 | 0.04 | |
| root changed | 0.56 | 0.08 | 0.52 | 0.07 | |
| import changed | 1.20 | 0.21 | 1.04 | 0.20 | |
| build, speed | cold | 10.17 | 9.99 | 10.28 | 9.85 |
| warm | 10.20 | 10.53 | 9.83 | 9.89 | |
| root changed | 9.35 | 10.11 | 9.32 | 9.73 | |
| import changed | 10.30 | 10.28 | 10.12 | 10.29 | |
| roc test | cold | 1.19 | 1.29 | 1.65 | 1.54 |
| warm | 0.55 | 0.02 | 0.71 | 0.02 | |
| root changed | 0.50 | 0.02 | 0.66 | 0.02 | |
| import changed | 0.97 | 0.16 | 1.32 | 0.22 |
roc-syntax-color
| step | condition | wall, old | wall, RC1 | CPU, old | CPU, RC1 |
|---|---|---|---|---|---|
| roc check | cold | 7.44 | 21.30 | 0.55 | 1.34 |
| warm | 0.31 | 0.02 | 0.03 | 0.01 | |
| root changed | 0.12 | 0.20 | 0.05 | 0.02 | |
| import changed | 1.80 | 1.43 | 0.33 | 0.12 | |
| build, dev | cold | 1.90 | 1.95 | 1.74 | 1.37 |
| warm | 1.91 | 0.03 | 1.00 | 0.03 | |
| root changed | 1.20 | 0.06 | 1.06 | 0.05 | |
| import changed | 1.42 | 0.13 | 1.31 | 0.12 | |
| roc test | cold | 3.60 | 4.31 | 1.58 | 1.68 |
| warm | 1.71 | 0.05 | 0.87 | 0.01 | |
| root changed | 2.04 | 0.12 | 0.93 | 0.02 | |
| import changed | 2.40 | 0.91 | 1.32 | 0.44 |
Output sizes
Bytes. roc-syntax-color's is an executable; roc-chat's, roc-markdown's and roc-screensaver's dev builds are x64 musl archives; the rest wasm.
| repository | build | bytes, old | bytes, RC1 |
|---|---|---|---|
| roc-apps | dev, web.roc | 2,414,652 | 1,157,562 |
| roc-apps | speed, web.roc | 694,691 | 767,406 |
| roc-chat | dev, main.roc | 9,913,118 | 6,944,412 |
| roc-screensaver | dev, main.roc | 1,578,826 | 2,051,318 |
| roc-screensaver | speed, web.roc | 309,719 | 335,528 |
| roc-markdown | dev, answers.roc | 1,547,010 | 1,624,096 |
| roc-markdown | speed, answers.roc | 356,064 | 402,030 |
| roc-syntax-color | dev, main.roc | 1,235,960 | 2,882,344 |
The box
One shared DigitalOcean droplet: 2 CPUs (Intel, KVM), 7.8 GiB, no swap, Ubuntu 24.04, with other agent lanes running. We didn't wait for a clean box; each TSV row records the load average, and for roc-screensaver and roc-apps the count of other programs running.
What we found
- The stricter checks caught real mistakes in our code: a plain record standing in for
CatandBird, and 83 shadows, one in our book's teaching example. - Testing a release candidate turned up two things to report, the boxy default's cost to one program and the nested-member warning. That's what a release candidate is for.
Pinning note: the 0.1.0_RC1 tag is
15177e9, three commits
before the announcement's
2eadd079; the binaries
were built from 15177e9, and our pins name it.