Rewrite our Core in either Go or Rust
What we built was great to validate the use case. We simplified our core so much that Motia is not heavily dependent on TypeScript. Motia Framework is pretty much an orchestrator of processes; it spawns a process for each step to get config or to run the handler.
These processes communicate using an IPC solution we developed. This IPC could be implemented in Go or Rust. Our framework uses API Routes and WebSockets, and these are also possible in Go/Rust.
The problem with Node is that some people have already started complaining about the need to use NPX to run a Python project, and with Go or Rust, they'd just need to download a binary using brew or similar. Then, we can say we're agnostic to language, and devs could choose whatever language they want.
π How much faster is Rust compared to Go?
The actual performance difference depends on the use case, but hereβs a general idea from benchmarks
| Task | Rust vs Go Speed |
|---|---|
| CPU-bound algorithms | Rust is 2xβ4x faster |
| Memory-intensive tasks | Rust is 2xβ5x faster |
| I/O-bound workloads | Difference is small (both are fast) |
| Web servers (real-world) | Rust can be 30β100% faster in latency/throughput benchmarks |
Rust ππΌ
My 5c
Whlle is ok to think which programming language is faster, either go or rust are compiled and fast but more important is how easy you can write and mantain code. IMHO, scalability should be provided by the infra layer (horizontal scaling) rather than the programming language performance.
I'd choose Go, because strong community, lot of packages, already validated with infrastructure monsters such as Kubernetes, and there are a lot of Go programmers out there.
Supporting Rust sounds more appealing
It's a complicated decision as by choosing Rust the development process can be more lengthy and hard but the benefits for speed are also great. The question is how much time you want to sacrifice in order to rewrite the stuff. If maintainability and scalability is going to be an issue then I will go with golang(my humble opinion).
Would choose go , while both go and rust are fast enough , go is more productive.
Even if the infra is responsible for the scalability, the cost of this scalability matters a lot, and the language choice is directly related to it. With Go, you have the best of both worlds with some compromises... and it is fine, actually. But if you are ok to invest in Rust, it will be a big win on the long term.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. Please feel free to comment if you believe this issue is still relevant. Thank you for your contributions to Motia! π
Hey @sergiofilhowz , Do we have a roadmap for rust core conversion ? would like to go small components wise so we can combine them up with an entire rust core , if possible make rust core with python bindings too
Hey @kingsmen732 π This is perfect timing. We're making our public roadmap available very soon, so stay tuned. Thanks.
Please keep your feature requests coming in.
Hey there (newbie here) I am currently learning backend development in go and made a few projects in it... i want to contribute if golang is selected as the rewrite language.. can anyone suggest me about pre-requisites to contribute?
We'll have more details soon, Stay tuned @code-grey