I implemented Perter Shirley's Ray Tracing in One Weekend in Roc. This is the final image from the first book and the repo is at https://github.com/shritesh/raytrace.roc
render
function implemented in Roc. It gave me a 10x speedup on my M1 Max. Wow, super cool @Shritesh Bhattarai! The image looks beautiful :)
yoooo this is amazing!!! :heart_eyes:
I have now implemented an elm-style {init, update, render}
platform. The init is called with the host provided {width, height, x,y}
values for every pixel in parallel (using Rust's Rayon). Then the update and render functions are repeatedly called (again in parallel) to update the state and draw the screen. https://github.com/shritesh/raytrace.roc/blob/main/platform/main.roc
I am calling this learning exercise "complete". It was really fun and helped me understand where Roc excels at and the current limitations. The clean separation of platform and application is a huge effing deal and changes the way you think about programming. I'm doubling down on Roc+Rust being my default stack of choice.
Last updated: Jul 06 2025 at 12:14 UTC