So I want to make a new project. It will have a website and an algorithm which will handle the requests. The thing is, web development in Rust feels harder than say in Go or Python. So I thought maybe I could somehow make bindings in Rust for Go since the faster the algorithm is, the better. However, that seems to complicate stuff as well. So do you think I should just rewrite the current algorithm in Go? Is it fast enough for it to not be a noticeable difference?
Edit: Thanks for the suggestions and advice! I decided to go with Rust for the website with Axum and the algorithm as well.
Premature optimization is the root of all evil. Implement algorithm the easiest way possible, profile your application, determine if this implementation a bottleneck or no. If yes, try other implementations, benchmark them and find the fastest one. Note that optimized go code can be faster than non-optimal code in rust, C, assembly or any other language.
Absolutely.
I’ve seen so many projects hindered by bad decisions around performance. Big things like shoehorning yourself into an architecture, language, or particular tool, but even small things like assuming the naive approach is unacceptably slow. If you never actually measure anything though, your assumptions are just assumptions.
Go is plenty fast for most things, and it is fairly simple. Rust is more interesting from a language geek perspective. I’d decide based on which of those appeals to you. I don’t see good reason to combine them, though.
First write it in Go, which will likely be faster unless you are quite familiar with Rust. After that, you can port some/all of it to Rust if you wish.
Edit: by ‘faster’ above, I mean faster to write.
Go with what you want to do. If you prefer writing in one language over an other, do it.
web development in Rust feels harder than say in Go or Python
Have you tried? There are some very nice web frameworks for Rust, like axum.