I’m giving a try (pun intended) at the new roc and I hope you don’t mind me reporting the issues I face here.
main! = || {
zeroU8 = 0u8
# Stdout.line!("zero: ${zeroU8}")
Stdout.line!("zero: ${0}")
}
This gives me the following error if I uncomment the line above:
Roc crashed: Error evaluating from shared memory: NotImplemented
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError
I’m on macos, M3
The u8 suffix is no longer roc syntax I believe
Can you make a github issue @Matthieu Pizenberg?
same crash without the u8
I've just "fixed" the crash error reporting on my branch, so it would surface the underlying issue in this case I think
ok I might wait for your fix branch merge then before making the issue.
This is the problem report that should be printed for you
-- UNUSED VARIABLE -------------------------------
Variable zeroU8 is not used anywhere in your code.
If you don't need this variable, prefix it with an underscore like _zeroU8 to suppress this warning.
The unused variable is declared here:
┌─ /Users/luke/Documents/GitHub/roc/test/fx/test_u8.roc:4:5
│
4 │ zeroU8 = 0u8
│ ^^^^^^
oh
roc check path/to/code is using the more mature BuildEnv setup and reports errors correctly
currently the run path e.g. roc path/to/app.roc uses a different path and doesn't print problems
Luke Boswell said:
roc check path/to/codeis using the more mature BuildEnv setup and reports errors correctly
for me roc check ... says the file is fine. (I’ve removed the u8 suffix) yet it crashes
Luke Boswell said:
This is the problem report that should be printed for you
-- UNUSED VARIABLE ------------------------------- Variable zeroU8 is not used anywhere in your code. If you don't need this variable, prefix it with an underscore like _zeroU8 to suppress this warning. The unused variable is declared here: ┌─ /Users/luke/Documents/GitHub/roc/test/fx/test_u8.roc:4:5 │ 4 │ zeroU8 = 0u8 │ ^^^^^^
I think you forgot to uncomment the line to get this warning.
Can you add a test for this issue to your new branch @Luke Boswell?
Kind of... I haven't really fixed it completely yet
I was talking with Richard about this issue earlier today
He has a refactor in progress for ModuleEnv to pull out the gpa which is somewhat related. I'm trying to implement a fix, but it's been a bit of a slog through lots of different issues -- and I'm not sure how close to the end I am rn
Thank you for sharing this @Matthieu Pizenberg
Made an issue: https://github.com/roc-lang/roc/issues/8433
Am I using the when syntax wrong here?
u4_to_hex : U8 -> String
u4_to_hex = |n| {
when n is
0 -> "0"
_ -> "0"
}
because I’m getting the following error:
-- PARSE ERROR -----------------------------------
A parsing error occurred: expr_arrow_expects_ident
This is an unexpected parsing error. Please check your syntax.
┌─ /Users/piz/git/roc-lang/roc/test/fx/hex.roc:16:12
│
16 │ 0 -> "0"
│ ^
-- UNEXPECTED TOKEN IN EXPRESSION ----------------
The token 0 is not expected in an expression.
Expressions can be identifiers, literals, function calls, or operators.
┌─ /Users/piz/git/roc-lang/roc/test/fx/hex.roc:16:13
│
16 │ 0 -> "0"
│ ^
...
It's called match now:
match is_ready {
True => "ready to go!"
False => "not ready yet"
}
ah ok. I suppose the tutorial page is not up to date. What is a good place to have an overview of the syntax of current roc?
Nice, ok this one passes the roc check but it gets me the same crash than the one with string interpolation. Should I add it to the same github issue?
main! = || {
zero : U8
zero = 0
zero_hex = u4_to_hex(zero)
}
u4_to_hex : U8 -> String
u4_to_hex = |n| {
match n {
0 => "0"
_ => "0"
}
}
We will try to update the tutorial before AoC starts. There is not a good place right now, as a temporary solution you can search through the folder test/snapshots. I will make an updated version of https://github.com/roc-lang/examples/blob/main/examples/AllSyntax/main.roc , that should come in handy.
Should I add it to the same github issue?
Sounds good
I also got a panic in the compiler that I also added to the issue.
I just updated my main, and tried to zig build test again after the fixes by @Richard Feldman in #8434 and now the tests are failing.
❯ zig build test
test
└─ tests_summary
└─ run test fx_platform_test 7/8 passed, 1 failed
error: 'fx_platform_test.test.fx platform match with wildcard' failed: Run failed with exit code 1
STDOUT:
STDERR:
Roc crashed: Error evaluating from shared memory: NotImplemented
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError
/Users/piz/git/roc-lang/roc/src/cli/test/fx_platform_test.zig:291:17: 0x104496f53 in test.fx platform match with wildcard (fx_platform_test)
return error.RunFailed;
What OS are you on?
osx 15.7.2
I could not reproduce this on macOS 26.1 with commit df660109487f6c7d96709413e9f34d6fbb862c89 on an M2 CPU. Did you make any changes in the folder (git status)?
I’m on the same commit, status completely clean. M3 cpu. MacOS Sequoia 15.7.2 (24G325)
Interesting...
I’m using zig 0.15.2 from brew
I downloaded zig directly from https://ziglang.org/download/
I'll try the brew version
Can you try again after running git clean -fdx? It's possible some artifacts from earlier runs altered things, that would not show up with git status.
Anton said:
I'll try the brew version
That did not make a difference.
I tried with the direct download executable did not change anything. However, after the git clean -fdx it worked! So I guess it kept in some local caches even though I had cleaned the folder, and removed the global user cache of zig
Thanks!
I’m getting the following runtime error:
Roc crashed: Num.U8 does not implement shift_right_by
Do you know where I need too look for the bitwise shift functions? Is it something in the stdlib or a platform thing?
@Matthieu Pizenberg we haven't added it yet (we are missing a TON of builtins in the new compiler!) - the full list of them is now in a single file: Builtin.roc
if you want to add those, check out as an example of how to do it
Are the files in src/builtins/roc still used?
no, we should delete them
I tried to implement the shifts, but since I don’t know zig, I asked some help from Claude. Unfortunately I’m not managing to have something that runs. I’m getting a panic when I run roc test/fx/shift.roc in my shift branch. If you want to have a look, but I don’t have more time this week I think to try and fix it.
Thanks for getting started @Matthieu Pizenberg, we'll take care of it :)
I’m a bit too stubborn and tried something else, but I fear something different is actually at play here, in addition to my struggles. When I try the following main:
main! = || {
one : U8
one = 1
two : U8
two = one.plus(one) # one + one
Stdout.line!("two: ${two}")
}
I get an error, though if I write one + one it works as expected. So maybe there is something wrong with the static dispatch itself on numeric types.
Roc crashed: Error evaluating from shared memory: NotNumeric
error: Failed to run with POSIX fd inheritance: error.ProcessExitedWithError
Interesting :thinking:
looking into it!
@Matthieu Pizenberg for a quick fix, it should be:
Stdout.line!("two: ${two.to_str()}")
but there are several compiler things that need to be fixed there:
roc check would have though)the stdout doesn’t help. I get the same error with just this:
main! = || {
one = 1u16
two : U8
two = one.plus(one) # one + one
}
I believe the 1u16 isn't valid syntax any longer
yeah the parser supports it but it isn't wired up to anything and we have a better replacement coming
I haven't taken it out of the parser yet because some tests are still using it and we don't have the replacement yet :sweat_smile:
but you should get a different error for that, namely that it's missing an expression at the end
Same error with that one too:
main! = || {
one : U8
one = 1
two : U8
two = one.plus(one) # one + one
Stdout.line!("two")
}
cool, I'll look into that too!
thanks for all the investigation btw :smile:
I reeeaaally wanted to try it ahah
got excited after the last recording XD
@Matthieu Pizenberg https://github.com/roc-lang/roc/pull/8466 should fix this!
Last updated: Nov 28 2025 at 12:16 UTC