Hey, I'd like to contribute more over the next few weeks. What would be the best way to do that so that we have a working interpreter for AoC?
Thanks Fabian, how familiar are you with zig?
I did ziglings and a few small changes in the compiler. So enough to be dangerous? But I also want to use this as a learning opportunity.
How do you feel about helping out investigating this general protection fault on the branch upgrade-to-zig-0.15.1:
GeneralProtectionFault.txt
Looks challenging, I like it. But no promises I manage to find anything.
:+1: No promises expected :p
I had a quick look at this, but I'm not 100% sure what the problem is exactly. Something with the changes to the Reader and Writer in 0.15.1. Maybe it would make sense to completely move the new ones? Would be a bit of work, but I think it should be done anyway? I will try it out if that fixes it.
to completely move the new ones
What do you mean exactly?
I assume typo - "completely move to the new ones?" :smiley:
Richard Feldman said:
I assume typo - "completely move to the new ones?" :smiley:
Yes typo. I thought maybe removing std.io.AnyWriter in favor of std.Io.Writer might help. But I'm not sure anymore. Now I think it's something with zstd.
I thought maybe removing std.io.AnyWriter in favor of std.Io.Writer might help.
Yeah that may be a good idea to clean things up.
removing std.io.AnyWriter in favor of std.Io.Writer
I'm going to take care of the merge conflicts on that branch and update to std.Io.Writer after.
The merge is done (and pushed), I will get on std.io.AnyWriter tomorrow.
The merged code still shows the "General protection exception" by the way.
The writergate struggle is real :p
yeah it's a big change in 0.15.1. I think the CompressingHashWriter
will be the biggest rework to support the new API. But there is std.io.Hashed
, which could be used together with an CompressingWriter
to get an CompressingHashWriter
again.
I appreciate all the work @Isaac Van Doren and @Anton have been doing getting us up to 0.15 -- looking forward to using the dev backend for x64 :smiley:
I updated all the deprecated writer/reader things and eventually got all of zig build test
to pass on my machine :tada:
Let's see what CI says...
Ok, cross-compiling and playground tests don't work but progress was made :p
I see that the playground wasm is broken now. I can go and try to fix that.
I fixed the playground on my fork. https://github.com/FabHof/roc/tree/upgrade-to-zig-0.15.1
Feel free to pull this in, or I create a PR
PR would be great, thank you! :smiley:
but roc build
still does not work. But it looks like there is a mismatch between the zig_llvm.h and the builder.zig.
I wonder what roc will see for compilation speed improvements with 0.15.1:
https://x.com/mitchellh/status/1974240007193047063?t=CTLqDlNDaQGhG1DJVMuELA&s=19
Very nice, I'm a little busy now but I can check later, zig build roc
and zig build
work on upgrade-to-zig-0.15.1 . I have not checked the last merged commit, but 0b1fdb5c82008695bacc3c89c6b3e3cfb44b6824 should work.
Simple time time zig build roc
on my slow machine:
main:
real 1m5,361s
user 1m21,896s
sys 0m8,542s
upgrade-to-zig-0.15.1:
real 0m24,207s
user 0m50,877s
sys 0m7,206s
is that an x86-64 machine?
yes: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Nice. More than 2x
what's still needed before we can land the 0.15.1 upgrade?
Looks like nothing changes sind ny PR, so roc build
probably still fails with an error, that is connected to changes in the zig_llvm.h, if I remember correctly. But I don't understand what those changes are supposed to do, so I didn't feel qualified to fix it.
I can get back on that next week
We are on zig 0.15.2 now, I did not wait for someone else to review, because this branch was accumulating merge conflicts all the time. Shoutouts to @Isaac Van Doren, @Fabian Schmalzried and gpt5-codex-high :robot:
Just updated the fuzz repo to 0.15.2. Running now, but I think it should all be good and fuzzing should keep running!
I'm working on that where
clause fuzz crash rn
We are on zig 0.15.2 now
Some common changes to the codebase with zig 15:
std.ArrayList
-> std.array_list.Managed
gpa.alignedAlloc(u8, 16, ...);
-> gpa.alignedAlloc(u8, std.mem.Alignment.@"16", ...);
callconv(.C)
-> callconv(.c)
writer: std.io.AnyWriter,
-> writer: *std.Io.Writer,
const stderr = std.io.getStdErr().writer();
try stderr.print("...\n", .{bool_type_idx});
After:
var stderr_buffer: [256]u8 = undefined;
var stderr_writer = std.fs.File.stderr().writer(&stderr_buffer);
const stderr = &stderr_writer.interface;
try stderr.print("...\n", .{bool_type_idx});
try stderr.flush();
AnyReader
, AnyWriter
, adaptToNewApi()
, GenericReader
, GenericWriter
. These do not mix well with the new way of doing things.build.zig.zon
has still .minimum_zig_version = "0.15.1",
. Is that on purpose?
No it was not, feel free to change it if you'd like to get in the commit under your name.
Last updated: Oct 20 2025 at 12:16 UTC