I was wondering if there's any way/library in Roc to write full stack code. I'm in search of a functional language to write isomorphic code for the frontend and backend (used to do this with Haskell, but GHCJS is a mess) and Roc looks like a great candidate.
If there's no library there that could do this but it is doable with Roc, I'd like to try doing so myself :)
I know that there are some Rust libraries that compile to WASM that allow you to write frontends in that way, was wondering if there was something done like this so I don't reinvent the wheel :)
Aaaand I just found https://github.com/roc-lang/roc/tree/main/examples with all the stuff I need, thanks for getting into this thread and reading these messages :)
I'm maintaining a roc awesome page which might be helpful. Also I think @Richard Feldman is working on a webserver at the moment for use at work. Keen to hear how you go with this, sounds like a fun project.
Roc compiles to Wasm so it can be a full stack solution.
But the virtual dom example doesn't compile so we put "WIP" in the directory name. When building it last year, we found some very difficult compiler bugs that aren't resolved yet.
We got the type checking bugs fixed but there's still some problems in later stages of the compiler (probably monomorphization, possibly code generation). I think we still have open issues on GitHub, which we should probably update!
I think as soon as the compiler issues are ironed out, then MVP could be express handlers calling roc wasm library + elm front end. Then gradually replace the non roc parts. I have no experience with roc, just eagerly awaiting
That stack could be a cool project. But "full stack Roc" probably wouldn't be the right term for it because it uses Elm for the front end.
And in fact that means it does not require implementing a virtual dom in Roc, so it would not be blocked by the compiler issues I mentioned.
I think my dream stack is roc + rest API + jsonschema + json-schema-to-elm + elm-land ( I know it's not full stack roc).
Last updated: Jul 06 2025 at 12:14 UTC