I will be launching yet another project, quite significant in scope, lasting at least a few years. I was playing a lot with AI chats recently, and I came to the conclusion that (at least for me) I will be using the following design: many, many micromodules written and tested by AI, and then a separate, entirely hand-written monolithic custom logic/control module where I do not allow AI to interfere. Somehow, I can't get AI to create my control logic correctly, but it is great at actual effector code.
To that end, I do not want to use Python, Lua, or script-like languages to build my logic. I will be using C++ (or similar) and maybe Roc as the main driver—in Roc I want to implement exactly that-> logic.
The caveat is that I will be using a RISC-V–based Linux platform, and I wonder how feasible it is to cross-compile and deploy a binary if I create one. According to my current research, it is in principle possible. What do you think?
So what I want is to create C++/Roc code, cross-compile it to Linux/RISC-V-32, and deploy binaries in Yocto (which is simple if I already have working binaries—and that step I will manage).
With the new zig compiler, I think this sounds achievable, though you wouldn't be using the typical roc build workflow. I imagine you would be using roc cli to build the app into an object file (assuming llvm compiles to your risc-v arch and therefore so could roc) and then using the C++ toolchain to link that with your host. Unfortunately I think you would need the full llvm backend implemented instead of just the interpeter, so the new zig compiler is a fair way off supporting that yet.
You could definitely simulate all of the above manually. We currently do something similar for the Int test platform in the main branch... we're simulating roc building an llvm bitcode file, and then linking everything together with the host to produce an executable. We built this now, even though it's not completely usable yet without the llvm backend, because we have validated in CI that we can cross-compile a fully static linux binary from any arch.
So you could copy this (maybe even literally make a branch and modify the Int test platform) and target risc-v instead.
I don't know anything about risc-v though. I can have a closer look tomorrow maybe if that would help. Just on my phone rn.
Somewhat related background in this article I wrote recently https://roc.zulipchat.com/#narrow/channel/303057-gatherings/topic/Roc.20Online.20Meetup.20Aug.202025/near/536885508
Thanks — this is not pressing at all (I still assume it’s possible with effort). I am only asking because I want to make an initial plan for my project in my head. When the time comes, I will try something and I will have very detailed questions. This will be among the last steps in my project, so easily a year from now. Still, I like to have a mental roadmap; that was the reason why I even asked.
Last updated: Oct 18 2025 at 12:13 UTC