Thought I'd share some cool progress on roc-ray -- I've been using this to help fix bugs in the platform/host side of things and validate the platform packages and linking designs. I got it to a pretty cool point today and wanted to share with everyone here.
app [Model, program] { rr: platform "https://github.com/lukewilliamboswell/roc-ray/releases/download/alpha-0-test/HB6qgLwjKqjmVXTxJEzFqnC72SJEfif98CnJ8ZVN86UE.tar.zst" }
import rr.Draw
import rr.Color
import rr.PlatformState
Model : {
message: Str,
}
program = { init!, render! }
init! : () => Try(Model, [Exit(I64), ..])
init! = || Ok({
message: "Roc :heart: Raylib!",
})
render! : Model, PlatformState => Try(Model, [Exit(I64), ..])
render! = |model, state| {
# Circle follows the mouse, changes color when clicked
circle_color = if state.mouse.left { Color.Red } else { Color.Green }
Draw.draw!(RayWhite, || {
Draw.text!({ pos: { x: 10, y: 10 }, text: model.message, size: 30, color: Color.DarkGray })
Draw.rectangle!({ x: 100, y: 200, width: 100, height: 80, color: Color.Red })
Draw.line!({ start: { x: 100, y: 500 }, end: { x: 600, y: 550 }, color: Color.Blue })
# Draw circle last so it is drawn over the top of other shapes
Draw.circle!({ center: { x: state.mouse.x, y: state.mouse.y }, radius: 50, color: circle_color })
})
Ok(model)
}
This is using a very alpha release that only has macos pre-built host binaries included, and definitely requires roc built from source. I'd like to get Linux and Windows hosts supported next I think before adding too many more features and making a real branch in the roc-ray repository.
$ roc build examples/hello_world.roc
Note* that we have a bug that prevents using the run subcommand, so you just have to build it first then run the executable.
Yay linux seems to be working now also :smiley:
lbw@lbw-B850-GAMING-X-WIFI6E:~/Documents/Github/roc-platform-template-zig$ file hello_world
hello_world: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
It's not a fully static binary though, I couldn't find a way to make it work with musl
I've found an issue with linking math symbols libm I'm digging into
Already this is way cooler than the original roc-ray implementation... no need to have a complete dev toolchain installed like cargo for application authors, just roc and your good to go!! (needs further testing to confirm this works for everyone)
Ok cool, fixed my maths symbols I think.
Anyone running linux... can you help me test this?
app [Model, program] { rr: platform "https://github.com/lukewilliamboswell/roc-ray/releases/download/alpha-0-test/EydNNTemUX6GMbTE4sY9JWqvLpPxvp2ZcwKDSn3WaDmB.tar.zst" }
import rr.Draw
import rr.Color
import rr.PlatformState
Model : {
message: Str,
}
program = { init!, render! }
init! : () => Try(Model, [Exit(I64), ..])
init! = || Ok({
message: "Roc :heart: Raylib!",
})
render! : Model, PlatformState => Try(Model, [Exit(I64), ..])
render! = |model, state| {
# Circle follows the mouse, changes color when clicked
circle_color = if state.mouse.left { Color.Red } else { Color.Green }
Draw.draw!(RayWhite, || {
Draw.text!({ pos: { x: 10, y: 10 }, text: model.message, size: 30, color: Color.DarkGray })
Draw.rectangle!({ x: 100, y: 200, width: 100, height: 80, color: Color.Red })
Draw.line!({ start: { x: 100, y: 500 }, end: { x: 600, y: 550 }, color: Color.Blue })
# Draw circle last so it is drawn over the top of other shapes
Draw.circle!({ center: { x: state.mouse.x, y: state.mouse.y }, radius: 50, color: circle_color })
})
Ok(model)
}
@Dan G Knutson you might be interested
Next up is Windows... though it might be worthwhile revisiting this issue first :shrug: https://github.com/roc-lang/roc/issues/8779
on linux
single file gui app lets goooo
Which distro are you running? what OS/Arch too?
ubuntu 24.04 x64, musl failed but glibc worked
Same over here! (on PopOS, which is basically ubuntu) I'm stoked for this
Sounds like I need to move this into a branch in roc-ray so we can start adding more features
The problem here is different: libraylib.a is a static library (.a), not a compiled binary. It contains object files with
unresolved symbols that expect to be linked against glibc at build time.
When raylib was compiled on an older system with _FORTIFY_SOURCE, the compiler generated calls to __sprintf_chk etc. Those symbols
existed in old glibc but have different signatures or are gone in glibc 2.42.
Backwards compat only works for:
- Fully linked executables/shared libraries (.so)
- They embed symbol versions like printf@GLIBC_2.2.5
Doesn't work for:
- Static .a files that still need to be linked
- They just have raw symbol references
So this is a build-time incompatibility, not a runtime one. The solution is rebuilding raylib on your system.
When I try to run with arch linux
Ok I had a similar issue with the Rust version... I think the solution here is to bundle the published raylib libraries and then write our own C wrapper instead of using zigraylib
They're published here https://github.com/raysan5/raylib/releases/tag/5.5
Luke Boswell said:
Sounds like I need to move this into a branch in roc-ray so we can start adding more features
Yes please.
It's been a busy day with work and I didn't achieve what I hoped to.
My goals at the start of the day:
libraylib.aroc-ray repositoryWhat I ended up doing instead
libraylib.a :check: I'll try and finish cleaning up and migrate to a repo tomorrow. I'd love to add Windows support and cut an alpha release sometime this week.
I'll be travelling for work all next week and it would be nice to know the harder integration issues (like linking hosts and dependencies) are resolved, and I can focus on adding features leading up to the online meetup.
Last updated: Feb 20 2026 at 12:27 UTC