Stream: announcements

Topic: Help prepare for AoC 2025


view this post on Zulip Luke Boswell (Nov 24 2025 at 22:51):

As you know we are getting close to Advent of Code -- and should have the compiler in a state that we can use it (for those brave enough).

If you have some time and would like to help, it would be great if you could try out the new compiler using a test platform and report any bugs or issues you find.

We've just started adding the builtins - so many functions are just missing an implementation. Feel free to make a PR if you can.

Here is a video I clipped showing how you can use the new compiler today.

https://youtu.be/XMWBx20QTgY

It's using the fx test platform, so only has Stdio effects available... and only works when built locally (not from a URL release) -- but that's all you need to get started solving AoC puzzles and trying out the new static dispatch and syntax.

We're resolving bugs in a tight loop (think hours not days) right now, so if you find any issues I would suggest letting us know in zulip and remember to sync with main as PR's land.

Looking forward to working with you all on Roc and preparing for AoC again this year :smile:

view this post on Zulip Dan G Knutson (Nov 25 2025 at 14:48):

Is there another step here to build libhost.a on a non-windows platform? I'm running into this failing-to-find-host-path error case locally on linux.

view this post on Zulip Anton (Nov 25 2025 at 14:51):

Hmm, did you run zig build test?

view this post on Zulip Dan G Knutson (Nov 25 2025 at 14:58):

Yeah; maybe some test is being skipped? I got 1533 passed on roc version debug-9e509c53.

view this post on Zulip Anton (Nov 25 2025 at 14:59):

I will try it on linux later today.

view this post on Zulip Dan G Knutson (Nov 25 2025 at 15:14):

I noticed fx_platform_test.zig now. If I run zig build test -- --test-filter 'fx platform' no tests are run, so I think that's getting skipped for some reason.

view this post on Zulip Anton (Nov 25 2025 at 15:21):

It needs to be 'fx_platform', that works for me, does it work for you?

view this post on Zulip Anton (Nov 25 2025 at 16:42):

I was able to reproduce the issue on linux

view this post on Zulip Norbert Hajagos (Nov 25 2025 at 17:06):

I hit that error as well on NixOs. Did zig build and zig build test before. Then with zig-out/bin/roc test/fx/app.roc I get:
error: Failed to resolve platform spec './platform/main.roc': error.PlatformNotSupported

view this post on Zulip Niclas Ahden (Nov 26 2025 at 17:06):

I also hit this issue on NixOS. build.zig has a check like target.query.isNativeCpu() and target.query.isNativeOs() and target.query.isNativeAbi() on line 816 and that'll be false on my machine since I'm using native CPU, native OS, but not native ABI (it's using musl not glibc). So I switched that to is_native (an existing variable with exactly this distinction). However, the tests fail and I'll attach the output.

test-output.txt

view this post on Zulip Anton (Nov 26 2025 at 18:30):

I'll try to take care of this issue tomorrow.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 18:44):

I'm blown away by how fast ./zig-out/bin/roc test/fx/app.roc is. It just goes BRRRT! Can't wait to use this compiler for everything... everything.

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:23):

Are there any WIP docs I can use while trying this out, or should I just look at the source code to figure out what’s available and where I can help out? I just built the compiler on macOS, and that part went great. :slight_smile:

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:25):

I'm going to try to post some tonight

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:32):

I tried to run a simple "hello world" program with the compiler using the following Roc file:

app [main!] { pf: platform "/Users/kevin/src/roc/test/fx/platform/main.roc" }

import pf.Stdout

main! = || {
    Stdout.line!("Hello, World!")
}

But running roc year2024day01.roc produced the following error message:

~/prj/advent-of-code $ roc year2024day01.roc

Roc crashed: Error evaluating from shared memory: TypeMismatch
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError

Am I doing something silly here? I'm running on the latest version of macOS and have the compiler running at debug-c442c8a0.

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:35):

if you have the repo checked out, what happens if you do (from the repo root) roc test/fx/app.roc?

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:36):

Richard Feldman said:

if you have the repo checked out, what happens if you do (from the repo root) roc test/fx/app.roc?

That seems to work fine.

~/src/roc (main) $ zig-out/bin/roc test/fx/app.roc
Hello from stdout!
Line 1 to stdout
Line 2 to stderr
Line 3 to stdout
Error from stderr!

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:36):

hm, maybe it's unhappy about the absolute path?

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:36):

for the platform location

view this post on Zulip Niclas Ahden (Nov 26 2025 at 20:39):

What if you rename the file to app.roc (rename the existing one)? I tried a few things and the filename seems to have an impact for me.

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:41):

It doesn't seem like a relative path helped. I changed the platform path to ../../src/roc/test/fx/platform/main.roc and got the same error. Renaming the file to app.roc did not work either.

What did work was coping the platform into the root of the directory where the file is and then reference it using a relative path (app [main!] { pf: platform "./platform/main.roc" }).

Perhaps I was mistaken in thinking I could reference a platform outside my project directory?

view this post on Zulip Niclas Ahden (Nov 26 2025 at 20:43):

To give context about the filename:

./zig-out/bin/roc test/fx/appc.roc
error: Child process /home/niclas/.cache/roc/43d450a451cacf424d42033893679acf/temp/roc-tmp-22donbk0q9xGfZH0fwb5a2jfUHqhJGXb/roc_run_349899816 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal
./zig-out/bin/roc test/fx/app.roc
Hello, World!

Same file contents

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:43):

I'll take a look at the relative path thing

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:44):

the name appc.roc works for me, but that is WILD

view this post on Zulip Niclas Ahden (Nov 26 2025 at 20:44):

Yeah, my wife tells me I'm pretty crazy

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:47):

Richard Feldman said:

I'll take a look at the relative path thing

Worth noting is that it only seems to work when the platform starts with ./path/to/platform. I tried moving the file from <PROJECT_ROOT>/year2024day01.roc into <PROJECT_ROOT>/year2024/day01.roc but then I got the same error because the platform path started with ../ now.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 20:48):

➜  roc_zig git:(main) ✗ cp test/fx/appc.roc test/fx/app.roc
➜  roc_zig git:(main) ✗ bat test/fx/app.roc
─────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ File: test/fx/app.roc
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ app [main!] { pf: platform "./platform/main.roc" }
   2 │
   3 │ import pf.Stdout
   4 │ import pf.Stderr
   5 │
   6 │ main! = || {
   7 │     Stdout.line!("Hello from stdout!")
   8 │     Stdout.line!("Line 1 to stdout")
   9 │     Stderr.line!("Line 2 to stderr")
  10 │     Stdout.line!("Line 3 to stdout")
  11 │     Stderr.line!("Error from stderr!")
  12 │ }
─────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜  roc_zig git:(main) ✗ bat test/fx/appc.roc
─────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     │ File: test/fx/appc.roc
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1 │ app [main!] { pf: platform "./platform/main.roc" }
   2 │
   3 │ import pf.Stdout
   4 │ import pf.Stderr
   5 │
   6 │ main! = || {
   7 │     Stdout.line!("Hello from stdout!")
   8 │     Stdout.line!("Line 1 to stdout")
   9 │     Stderr.line!("Line 2 to stderr")
  10 │     Stdout.line!("Line 3 to stdout")
  11 │     Stderr.line!("Error from stderr!")
  12 │ }
─────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
➜  roc_zig git:(main) ✗ ./zig-out/bin/roc test/fx/app.roc
Hello from stdout!
Line 1 to stdout
Line 2 to stderr
Line 3 to stdout
Error from stderr!
➜  roc_zig git:(main) ✗ ./zig-out/bin/roc test/fx/appc.roc
error: Child process /home/niclas/.cache/roc/43d450a451cacf424d42033893679acf/temp/roc-tmp-MxVgzDoyVPsmTvDDcEvMe750Tm0mrDPP/roc_run_349899816 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal

idk man, my computer is drunk :joy:

view this post on Zulip Richard Feldman (Nov 26 2025 at 20:52):

is this on current main? so, 587c53210286757876478579d2c17cd59f834198

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 20:59):

I just tried what @Niclas Ahden mentioned on my machine (M1 MBP on macOS 15.16.1) and ./zig-out/bin/roc test/fx/appc.roc ran without a problem on 587c53210286757876478579d2c17cd59f834198.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:02):

Nope, I was on df66010948. Pulled 587c532102, git clean -dfx, re-added this diff:

diff --git i/build.zig w/build.zig
index 57fb74fa51..d9d0c6bd4d 100644
--- i/build.zig
+++ w/build.zig
@@ -1044,7 +1044,7 @@ pub fn build(b: *std.Build) void {
     const is_windows = target.result.os.tag == .windows;

     // fx platform effectful functions test - only run when not cross-compiling
-    if (target.query.isNativeCpu() and target.query.isNativeOs() and target.query.isNativeAbi()) {
+    if (is_native) {
         // Create fx test platform host static library
         const test_platform_fx_host_lib = createTestPlatformHostLib(
             b,

Rebuilt with zig build, then:

./zig-out/bin/roc test/fx/app.roc
error: Child process /home/niclas/.cache/roc/8a126c1a3b33ced3831765bc6d91e1bc/temp/roc-tmp-LPoA9CbVzOVdzCLySvGz5YtBiD4lWT8i/roc_run_792223834 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal

I'll try the same on my Mac.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:10):

Works perfectly on the Mac (ARM). Not on NixOS (x86) sadly.

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:30):

ok see if it works on this branch: https://github.com/roc-lang/roc/pull/8461

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:30):

(I'm guessing probably still doesn't work on NixOS but relative paths should work better!)

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 21:33):

Richard Feldman said:

ok see if it works on this branch: https://github.com/roc-lang/roc/pull/8461

I tried rebuilding the compiler but got:

test
└─ tests_summary
   └─ run test fx_platform_test 12/13 passed, 1 failed
error: 'fx_platform_test.test.fx platform with dotdot starting path' failed: Run failed with exit code 1
STDOUT:
STDERR:
Roc crashed: Error evaluating from shared memory: TypeMismatch
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError

/Users/kevin/src/roc/src/cli/test/fx_platform_test.zig:146:17: 0x1005c908b in test.fx platform with dotdot starting path (fx_platform_test)
                return error.RunFailed;
                ^
error: while executing test 'fx_platform_test.test.fx platform checked directly finds sibling modules', the following test command failed:
./.zig-cache/o/8b01e086a989ec45c18eb3c0c3b150b3/fx_platform_test --cache-dir=./.zig-cache --seed=0x73d04778 --listen=-

Build Summary: 54/57 steps succeeded; 1 failed; 1590/1591 tests passed; 1 failed
test transitive failure
└─ tests_summary transitive failure
   └─ run test fx_platform_test 12/13 passed, 1 failed

error: the following build command failed with exit code 1:
.zig-cache/o/cc6d41c01a0793b6188e07ef840af6b0/build /Users/kevin/.asdf/installs/zig/0.15.2/zig /Users/kevin/.asdf/installs/zig/0.15.2/lib /Users/kevin/src/roc .zig-cache /Users/kevin/.cache/zig --seed 0x73d04778 -Za49efdac55e7b81a test

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:35):

I could verify that the branch fixes the relative path issue. No build error unlike Kevin.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:36):

(and it still doesn't work on NixOS as expected)

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:43):

@Kevin Hovsäter what OS are you running?

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 21:45):

Richard Feldman said:

Kevin Hovsäter what OS are you running?

M1 MBP on macOS 15.16.1.

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:47):

M1 MBP on macOS 26.1 (25B78)

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:50):

so weird! I don't know what the issue is

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:51):

FYI here is the WIP tutorial I'm working on - just have the very basics so far https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4

we do actually have bundled platforms working, so in theory we could package up the test/fx/ platform for all the different OSes and distribute it, but we should probably try to get NixOS working first

view this post on Zulip Richard Feldman (Nov 26 2025 at 21:52):

@Kevin Hovsäter if you do zig build without running tests, and then run the compiled roc manually, does that work?

view this post on Zulip Kevin Hovsäter (Nov 26 2025 at 21:53):

Richard Feldman said:

so weird! I don't know what the issue is

I'm heading to bed, but I can try to investigate further tomorrow!

view this post on Zulip Niclas Ahden (Nov 26 2025 at 21:57):

Double-checking:

zig build test
✅ All 1591 tests passed.

view this post on Zulip isaactfa (Nov 26 2025 at 22:16):

I'm on x86_64-linux-gnu and experiencing the same issue.

Richard Feldman said:

FYI here is the WIP tutorial I'm working on - just have the very basics so far https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4

Whether grabbing the nightly like in this tutorial or building from source, I can't get the fx platform to work either. Initially, I get

$ roc version
Roc compiler version release-fast-299268c2

$ roc test/fx/app.roc
error: Failed to resolve platform spec './platform/main.roc': error.PlatformNotSupported

After adjusting build.zig to actually build test/fx/platform/libhost.a, the error becomes

$ roc test/fx/app.roc
error: Child process /home/timob/.cache/roc/387646676cd876895a972bc305e43fc4/temp/roc-tmp-KBw2ppRjjpmtiooxunMoZ47aR77MhrJ5/roc_run_792223834 killed by signal: 11
error: Child process crashed with segmentation fault (SIGSEGV)
error: Failed to run with POSIX fd inheritance: error.ProcessKilledBySignal

I can't seem to usefully attach a debugger to anything, so my investigation unfortunately has had to stop here so far.

view this post on Zulip Richard Feldman (Nov 26 2025 at 22:22):

I'll try to debug that tonight

view this post on Zulip Niclas Ahden (Nov 26 2025 at 22:22):

I tried fix-segfault/ca81b2916 but that didn't affect this issue. Happy to test more tomorrow, good night!

view this post on Zulip Notification Bot (Nov 27 2025 at 06:02):

8 messages were moved from this topic to #contributing > Help prepare for AoC 2025 - Testing a platform from URL by Luke Boswell.

view this post on Zulip Anton (Nov 27 2025 at 19:33):

Anton said:

I'll try to take care of this issue tomorrow.

I have not looked into this yet, I'll prioritize it tomorrow.


Last updated: Nov 28 2025 at 12:16 UTC