motia icon indicating copy to clipboard operation
motia copied to clipboard

Rewrite our Core in either Go or Rust

Open sergiofilhowz opened this issue 5 months ago β€’ 11 comments

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

sergiofilhowz avatar Jul 23 '25 11:07 sergiofilhowz

Rust πŸ‘πŸΌ

rodrigomf24 avatar Jul 31 '25 16:07 rodrigomf24

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.

brunocascio avatar Aug 05 '25 00:08 brunocascio

Supporting Rust sounds more appealing

bristinWild avatar Aug 25 '25 17:08 bristinWild

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).

UmairAhmedImran avatar Aug 25 '25 20:08 UmairAhmedImran

Would choose go , while both go and rust are fast enough , go is more productive.

kasyap1234 avatar Aug 26 '25 03:08 kasyap1234

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.

soubinan avatar Aug 31 '25 13:08 soubinan

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! πŸš€

github-actions[bot] avatar Oct 31 '25 02:10 github-actions[bot]

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

kingsmen732 avatar Nov 23 '25 14:11 kingsmen732

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.

rohitg00 avatar Nov 23 '25 22:11 rohitg00

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?

code-grey avatar Nov 25 '25 07:11 code-grey

We'll have more details soon, Stay tuned @code-grey

rohitg00 avatar Nov 25 '25 09:11 rohitg00