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.

view this post on Zulip Anton (Nov 28 2025 at 21:18):

The PlatformNotSupported error on linux should be fixed with PR#8490. Please give latest main a try again.

view this post on Zulip Dan G Knutson (Nov 29 2025 at 02:41):

On linux on latest main, I'm now getting the ProcessKilledBySignal Isaac describes above when running zig build test (which is good!). I get what I assume is the same segfault when running ./zig-out/bin/roc test/fx/app.roc directly. If I use gdb like:

gdb ./zig-out/bin/roc
(gdb) run test/fx/app.roc
(gdb) backtrace

I get No stack., but I don't know if that's me doing something incorrect or not.

view this post on Zulip Anton (Nov 29 2025 at 09:51):

I'll check it out

view this post on Zulip Anton (Nov 29 2025 at 12:55):

PR#8497 is up to fix this

view this post on Zulip Anton (Nov 29 2025 at 12:59):

You may need to do git clean -fdx to delete old build artifacts.

view this post on Zulip Anton (Nov 29 2025 at 14:20):

zig build test and ./zig-out/bin/roc test/fx/app.roc now works on my ubuntu 24 machine on latest main :)

view this post on Zulip Niclas Ahden (Nov 29 2025 at 14:28):

Can confirm on NixOS (x86). Sweet!

view this post on Zulip Richard Feldman (Nov 29 2025 at 14:32):

btw I'm expanding on this tutorial gist - I've now added some stuff on for loops, var, and block expressions: https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4 (it's still WIP overall, but hoping to have it complete before Dec 1!)

view this post on Zulip Jamie Neubert Pedersen (Dec 01 2025 at 05:35):

Niclas Ahden said:

Can confirm on NixOS (x86). Sweet!

I tried getting the main branch to work on nix, but I don't know if I'm doing things the right way.

{
  description = "A development environment for Roc projects";

  inputs = {
    # Define the roc input, pointing to the official GitHub repository
    roc.url = "github:roc-lang/roc";
    # Ensure nixpkgs follows the version used by the Roc repository for compatibility
    nixpkgs.follows = "roc/nixpkgs";
  };

  outputs = { self, nixpkgs, roc }:
    let
      # Define the systems your flake will support
      supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      # Helper function to generate outputs for each system
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
    in
    {
      devShells = forAllSystems (system:
        let
          pkgs = import nixpkgs { inherit system; };
          rocPkgs = roc.packages.${system};
        in
        {
          # Define the development shell
          default = pkgs.mkShell {
            buildInputs = [
              rocPkgs.cli # Add the Roc CLI to the environment
            ];

            # Optional: Add a shell hook for convenience, e.g., setting an environment variable
            shellHook = ''
              export ROC=roc
              echo "Roc development environment loaded. Use the 'roc' command to get started."
            '';
          };
        });
    };
}

I get this error when running the main.roc from the gist for AOC:

app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/7iDKk44no3gF9Nrh2VyF8Y5yvy1jUBhrbhHURN1WQptB.tar.zst" }

import pf.Stdout

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

Gives this when run:

$ roc main.roc
── INVALID EXTENSION SUFFIX in main.roc ────────────────────────────────────────

I tried to download from this URL:

    https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/7iDKk44no3gF9Nrh2VyF8Y5yvy1jUBhrbhHURN1WQptB.tar.zst

However, this file's extension (.zst) is not a supported extension.

The supported extensions are .tar, .tar.gz and .tar.br

Tip: Check that you have the correct URL for this package/platform.

view this post on Zulip Luke Boswell (Dec 01 2025 at 05:36):

I think you may be using the old rust compiler. I'm not sure if we have a flake for the new zig compiler setup

view this post on Zulip Hannes (Dec 01 2025 at 05:45):

I'm not sure if we have a flake for the new zig compiler

I'm working on it! https://github.com/roc-lang/roc/pull/8351

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 08:48):

When creating a new folder somewhere on my disk for AoC, and adding the app.roc there. And changing the platform path to an absolute one, it seems roc doesn’t find the platform:

❯ roc app.roc
error: No platform found. Every Roc app requires a platform.
error: Failed to set up shared memory with ModuleEnv: error.NoPlatformFound

What am I missing?

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:49):

I think this is a security feature

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:49):

I would recommend you use a platform from a URL -- of which there is only one right now

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:49):

https://github.com/lukewilliamboswell/roc-platform-template-zig/releases

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:50):

Can you try using the example from here https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 08:53):

I’m getting this with the url one:

❯ roc app.roc
-- TYPE MISMATCH ---------------------------------

This expression is used in an unexpected way:
  ┌─ app.roc:9:1
  │
9 │ main! = || {
  │ ^^^^^

It has the type:
    ({}) => {  }

But the type annotation says it should have the type:
    List(Str) => Try([Exit(I32)])

Found 1 error(s) and 0 warning(s) for app.roc.
thread 9141557 panic: reached unreachable code
???:?:?: 0x102a681cb in ??? (roc_run_1662736024)
???:?:?: 0x102a7362f in ??? (roc_run_1662736024)
???:?:?: 0x102a624e3 in ??? (roc_run_1662736024)
???:?:?: 0x102a6027f in ??? (roc_run_1662736024)
???:?:?: 0x102a5fce3 in ??? (roc_run_1662736024)
???:?:?: 0x1029c87eb in ??? (roc_run_1662736024)
???:?:?: 0x1029c96ef in ??? (roc_run_1662736024)
???:?:?: 0x18332ab97 in ??? (???)
???:?:?: 0x0 in ??? (???)
error: Child process /Users/piz/Library/Caches/roc/072c932d3be8db1509821ec0a451d264/temp/roc-tmp-INcgCagWvk2ArLrvuFFrTiOIL1N8raew/roc_run_1662736024 killed by signal: 6
error: Child process aborted (SIGABRT)

Is it because I’m using my roc build from main instead of the roc build from that same release?

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:54):

The platform API is different, it passes args

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 08:54):

ok I’ll read Richard post more

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:55):

Try this

app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/7iDKk44no3gF9Nrh2VyF8Y5yvy1jUBhrbhHURN1WQptB.tar.zst" }

import pf.Stdout

main! : List(Str) => Try({}, [Exit(I32)])
main! = |_args| {
    Stdout.line!("Hello Roc!")

    Ok({})
}

view this post on Zulip Luke Boswell (Dec 01 2025 at 08:56):

Oh, richard's notes around the main! part aren't right -- missing the |_args|

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 08:58):

The first code block is correct. And notes incorrect indeed. Got it working by adding the _args and the Ok({}). Thanks

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 09:00):

If I don’t add the Ok({}). The behavior is a little weird. It tells me the code doesn’t type check. Yet it runs anyway, print stuff, and crashes at the end.

view this post on Zulip Luke Boswell (Dec 01 2025 at 09:03):

Yep -- we run anyway even if there are type errors at compile time, they become runtime crashes

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 10:58):

I just made this PR for modulus on integer types, since it might be very useful for AoC day 1. https://github.com/roc-lang/roc/pull/8528

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 12:20):

Seems from_str will also be needed for numeric types, or at least for integer types to be able to solve day 1. And I think this one might be a bit too complicated to implement for me? I don’t know. Is someone looking into from_str functions already?

view this post on Zulip Anton (Dec 01 2025 at 13:20):

Seems from_str will also be needed for numeric types, or at least for integer types to be able to solve day 1.

Yes that makes sense

I don’t know. Is someone looking into from_str functions already?

Not that I know of

I think this one might be a bit too complicated to implement for me?

Possibly, feel free to give it a try and let us know if/when it starts to get complicated.

view this post on Zulip Richard Feldman (Dec 01 2025 at 15:28):

PR for from_str: https://github.com/roc-lang/roc/pull/8529

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 16:54):

I almost have a working AoC day1, but now having issues with a use after free ^^. Will try to simplify the example.

view this post on Zulip stephdin (Dec 01 2025 at 17:30):

Hey everyone, i wanted to give roc a try and followed Richards tutorial above. I downloaded the windows nightly build (x86_64-2025-11-30) and added a main.roc file with the provided Hello World sample. I am running into a problem about a missing windows sdk, do i need to install anything else?

> .\roc.exe --version
Roc compiler version release-fast-77e8bbc1

> .\roc.exe main.roc
error: Failed to link executable: error.WindowsSDKNotFound

I am running this on a fairly standard Windows (11 Pro 25H2) installation. Let me know, how i can help debug the issue or if i should open an issue somewhere. I am very excited to give roc a try.

view this post on Zulip Richard Feldman (Dec 01 2025 at 18:17):

thanks! I wonder if we could reproduce this on CI somehow :thinking:

view this post on Zulip Anton (Dec 01 2025 at 18:36):

Likely not, github CI will be preconfigured with the right stuff

view this post on Zulip Anton (Dec 01 2025 at 18:36):

New nightlies already test on windows

view this post on Zulip Anton (Dec 01 2025 at 18:45):

Anton said:

Likely not, github CI will be preconfigured with the right stuff

We could set up our own server for this but I think once we solve the issues with new windows machines it will stay solved

view this post on Zulip Luke Boswell (Dec 01 2025 at 20:23):

@stephdin are you using the default powershell terminal?

view this post on Zulip Luke Boswell (Dec 01 2025 at 20:27):

For anyone interested... here is the relevant part of the code for this issue https://github.com/roc-lang/roc/blob/949102f53db7908d214925ae74af333aee1d95fc/src/cli/linker.zig#L264-L267

view this post on Zulip stephdin (Dec 01 2025 at 20:39):

Yes, i am using Windows Terminal with PowerShell 7.5.4

view this post on Zulip Luke Boswell (Dec 01 2025 at 20:42):

This kind of issue is hard for us to debug because it requires a fresh Windows install. I think if you have developer tools installed or things already set up it can be hard to reproduce.

view this post on Zulip Luke Boswell (Dec 01 2025 at 20:42):

I think the issue is Windows can't find those libraries by default for some reason, even though I'm pretty sure they are on your system

view this post on Zulip stephdin (Dec 01 2025 at 20:47):

Thank you for your answer, i will investigate why these libraries cannot be found. I have indeed some developer tools installed, maybe they mess with my setup

view this post on Zulip Luke Boswell (Dec 01 2025 at 20:48):

Can you try running the roc executable from within another shell? if you have Visual Studio for example from within there

view this post on Zulip Johannes Rubenz (Dec 01 2025 at 21:00):

On macOS (M1), I’m trying to get the current workaround to run using:

zig build roc
from the root of the freshly cloned (latest) Roc repository.

However, I’m getting the following error:
roc/build.zig.zon:2:14: error: expected string literal .name = .roc, ^~~

Could anyone point out what I’m doing wrong?

view this post on Zulip Luke Boswell (Dec 01 2025 at 21:04):

What version of zig are you using? you need to be on 0.15.2

$ zig version
0.15.2

view this post on Zulip Johannes Rubenz (Dec 01 2025 at 21:06):

ah, I see – I'm currently on 0.11.0
thanks a lot, Luke!

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 22:49):

Is there a function in your platform @Luke Boswell to read from a file? I think that’s my last missing piece

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 22:49):

Otherwise, I will copy paste the whole input.

view this post on Zulip Luke Boswell (Dec 01 2025 at 22:50):

No effect to read from a file

view this post on Zulip Luke Boswell (Dec 01 2025 at 22:50):

It would be pretty easy to add one if you wanted though

view this post on Zulip Luke Boswell (Dec 01 2025 at 22:51):

I was just planning on keeping the template minimal(ish) to focus on the key parts -- with the timing of everything it was the only platform usable in time for AoC

view this post on Zulip Dan G Knutson (Dec 01 2025 at 22:59):

Is importing strings from files implemented?

view this post on Zulip Luke Boswell (Dec 01 2025 at 23:00):

I'm not sure -- I don't think so

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:01):

Folks we have a valid Roc solution :tada:

❯ roc day01.roc
Part 1 (demo): 3
Part 1: 1135
Part 2 (demo): 6
Part 2: 6558
error(gpa): memory address 0x101200040 leaked:
Unable to print stack trace: Unable to open debug info: MissingDebugInfo

error(gpa): memory address 0x101260000 leaked:
Unable to print stack trace: Unable to open debug info: MissingDebugInfo

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:02):

Still a few issues as you can see ahah. And also quite slow to compute ^^. But it’s correct!

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:03):

yeah the interpreter is not at all optimized for speed right now :laughing:

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:03):

I'm sure we can make it a lot faster, and we're all set up to JIT if desired

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:06):

Here for those interested in looking at it (spoiler!)

AoC day 01 solution in Roc

view this post on Zulip Luke Boswell (Dec 01 2025 at 23:08):

Roc is looking so good, thank you for sharing @Matthieu Pizenberg

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:11):

Thanks for working on the language! Excited to see it mature this year!

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:25):

thanks for helping it mature - there's no substitute for battle testing like this to find bugs! :smile:

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:30):

There are a few things that did not work so I worked around by rewriting another way. I don’t remember all. Here is those that I remember:

Writing print! like this does not compile with the rest of the program (haven’t checked alone)

print! = |msg| msg.split_on("\n").for_each!(Stdout.line!)

I would have loved to be able to use ? directly in the for loop, but then propagating it in main! would still have needed another wrapper function like run! to unwrap and convert the various tags into the I32 error that the main expects. If possible, would be nice to have the main accept whatever tag in the error.

abs for integers. An easy one missing. Maybe a good first issue?

I think I hit some issues with the var at some point but I’m not 100% positive on that one. It seems there a few memory issues left. Good luck chasing those!

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:35):

I'll jump on all of these tonight - I'm not really trying to save Advent of Code bugfixes for first contributions; I just want to unblock ASAP :smile:

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:38):

btw we optimized the type of main! in basic_cli for being able to have ? inside main! Just Work - probably too late for Advent of Code to be changing the type signature of main! again, but it's good feedback to know that you independently ran into wanting this!

view this post on Zulip Luke Boswell (Dec 01 2025 at 23:54):

This is the signature for the template platform from your notes main! : List(Str) => Try({}, [Exit(I32)]) I thought that was good for that reason? or are we missing the open union in the tag?

view this post on Zulip Luke Boswell (Dec 01 2025 at 23:54):

I couldn't get an open union working there... but I think I just couldn't remember the syntax we landed on

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:55):

yeah the open union is the key

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:56):

in basic_cli it's something like [Exit(I32), .._others] in the new syntax (I'm not sure if that new syntax actually works though!)

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:56):

If I comment my Ok in the run! function it gives me this error with the syntax for the open union:

run! = || {
    print!("Part 1 (demo): ${part1!(demo_input.trim())?.to_str()}")
    print!("Part 1: ${part1!(day_input.trim())?.to_str()}")
    print!("Part 2 (demo): ${part2!(demo_input.trim())?.to_str()}")
    print!("Part 2: ${part2!(day_input.trim())?.to_str()}")
    #Ok({})
}

main! = |_args| {
    match run!() {
        Ok(_) => Ok({})
        Err(_) => Err(1)
    }
}

error:

❯ roc day01.roc
-- TYPE MISMATCH ---------------------------------

This expression is used in an unexpected way:
   ┌─ day01.roc:85:5
   │
85 │     print!("Part 2: ${part2!(day_input.trim())?.to_str()}")
   │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It has the type:
    {}

But I expected it to be:
    [BadNumStr, Err([BadNumStr])][BadNumStr, BadNumStr]_others

Found 1 error(s) and 0 warning(s) for day01.roc.
Part 1 (demo): 3
Part 1: 3
Part 2 (demo): 6
Part 2: 6

Roc crashed: non-exhaustive match

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:56):

we should also really allow [Exit(I32), ..] instead of [Exit(I32), .._others] because the former reads way better :laughing:

view this post on Zulip Luke Boswell (Dec 01 2025 at 23:57):

@Matthieu Pizenberg you would need to change the API in the platform/main.roc -- if you're running the zig template locally you could try it out

view this post on Zulip Richard Feldman (Dec 01 2025 at 23:57):

@Matthieu Pizenberg that's the old syntax, I think that error message is just out of date and printing the wrong thing

view this post on Zulip Matthieu Pizenberg (Dec 01 2025 at 23:57):

I thought about having a look. But I think I’ve already spent a bit too much time for now ^^

view this post on Zulip Ryzh (Dec 05 2025 at 20:26):

#announcements > Help prepare for AoC 2025 @ 💬

Is this still an actual way to get a new compiler? (build from the source code using Zig 0.15.2)
I found a message that there is a nightly build, but I did not find it.

view this post on Zulip TeaDrinkingProgrammer (Dec 05 2025 at 20:45):

Richard Feldman said:

btw I'm expanding on this tutorial gist - I've now added some stuff on for loops, var, and block expressions: https://gist.github.com/rtfeldman/f46bcbfe5132d62c4095dfa687bb9aa4 (it's still WIP overall, but hoping to have it complete before Dec 1!)

This guide is probably what you are looking for. It is still mostly up to date (I think?), only thing you need to do to get it working is to update the platform url to the newest release.


Last updated: Dec 21 2025 at 12:15 UTC