As promised, Trantor is a system for building a Roc platform in Rust out of Roc+Rust components. I think it's important to have some middle point between "everything is provided for you" and "learn Rust and fork the platform" and Trantor is my attempt at providing that. The README example shows a migration path starting from the Trantor stdlib through a Rust module and winding up with a Roc module providing the same interface. That's the general idea behind the system and I'm releasing it now in hopes of getting feedback.
I've also put together a set of packages to test how the system fits together and fill the role of a stdlib for the platform:
I've migrated my (still) unreleased UI platform over. So I feel the system is decent enough to release but it's also only tested on my mac and I'm not sure how it'll do on Linux. The interface system is also pretty awkward in that it needs to be re-declared in TOML because I didn't want to get into Roc parsing as part of this initial effort.
Thoughts?
Looks pretty cool! It does make me wonder whether Rust should allow libraries to declare that certain functions are pure even when they cross into the host. See Karl's paragraph here about about add! for context:
https://github.com/grayrest/trantor-temporal#effectful-arithmetic
This solves one of the worries I had: what if I need to add something that can realistically only be done using an external service (pandoc, imagemagick, ffmpeg, etc.). This solves that perfectly! Very cool!
Effectful is just a naming convention so I've tried it a couple times with host functions. The problem with pure host functions is that the compiler tries to inline and constant fold them and that fails because they're not Roc. I've gotten away with it for some leaf functions like reading values in a SQLite row but trying to do it with Temporal failed.
I think Temporal is a good example in that there's no particular reason it couldn't be done in Roc but I'd rather rely on math being shipped in a browser and the cost is add!
I would have thought "effectful" had more than naming implications. My naive fear was that every function that calls add! would also have to be treated as effectful, and that might prevent Roc from certain optimizations related to pure functions.
Not naïve and it does prevent the full set of optimizations. I would expect that not to matter if you're outside a hot loop but Roc perf swings a LOT depending on how the optimizations land so it's hard to say whether it'd be a problem or not.
Last updated: Sep 24 2026 at 15:59 UTC