Stream: ideas

Topic: Roc-botics


view this post on Zulip Luke Boswell (Sep 26 2023 at 22:08):

Hey I'm interested in exploring Roc for robotics/embedded applications and wondering if anyone else has an interest in this area? I'm not super experienced, but once upon a time studied electronics engineering, so keen to stratch an itch and maybe make some cool stuff with my nieces and nephews. I have very vague ideas at the moment like, maybe I could build an RTOS micro kernal in Zig, and have all "userspace" code in Roc or something. Probably a huge project... but just exploring ideas rn and wondered if anyone had ideas in this direction.

view this post on Zulip Brendan Hansknecht (Sep 26 2023 at 23:18):

I messed with this some quite a while ago. Was building on top of rust and embassy.

view this post on Zulip Brendan Hansknecht (Sep 26 2023 at 23:19):

Code is quite outdate and not really anything too useful, but was enough to prove a basic concept: https://github.com/bhansconnect/roc-microbit

view this post on Zulip Brendan Hansknecht (Sep 26 2023 at 23:22):

Two immediate thoughts here:

  1. Roc has limited system support. Depending on what you target, some compiler expansion would be required. You also will probably be stuck with 32bit arm or theoretically risc-v devices. Roc currently has no concrete plans to support 8 bit devices like an arduino.
  2. Linking and other stuff of that nature can be more complex if targeting true embedded devices. Obviously much easier to build off of a device that can run linux already like a raspberry pi.

view this post on Zulip Brendan Hansknecht (Sep 26 2023 at 23:24):

Oh and one other thought: Roc expects an allocator and dynamic memory. That can be done on embedded devices, but is sometimes too expensive. This probably hurts the most when you could use a simple array but realize that Roc only has dynamically allocated lists. These features could be a non-starter for a number of embedded projects depending on the exact goals. Roc will not give you any sort of memory guarantees.

view this post on Zulip Luke Boswell (Sep 26 2023 at 23:49):

Thank you @Brendan Hansknecht this is helpful feedback. I'll put my current idea into a diagram I think. I'm currently thinking along the lines of using Roc for writing "mission" code for a Robot (think car maybe), and compiling that to wasm, which is then loaded in and executed. One of my design goals is that it should be simple enough for my young family members to write some code and see it in action.

view this post on Zulip Brendan Hansknecht (Sep 27 2023 at 01:07):

Definitely should be doable, though feels like something that would work best if targeting a very specific robot


Last updated: Jun 16 2026 at 16:19 UTC