Hacker News new | ask | show | jobs
by echelon 3533 days ago
I wrote a Donald Trump text to speech server in Rust. It's blazingly fast. If I'd written it in Python, it'd have taken seconds to generate audio. If I'd written it in C++, it'd likely have memleaked or segfaulted since I'm not skilled or patient enough to write safe C++.

Rust is pretty much the coolest thing ever in my opinion. It's easy and fun to write. Cargo is the best package manager ever, and makes importing library code a breeze. I've never had multithreaded code warn me when I don't lock it correctly. It's so awesome.

(wrt my Rust app, as soon as I load test and redesign the UI I'm going to share it on HN. It's pretty ridiculous and we have a lot of fun with it at work.)

1 comments

Have you tried with Go?
I'm honestly not a very big fan of Go. We use it at work and it just isn't something I want to come home and write. Different strokes, I guess.

I'm sure that Go would have performance characteristics closer to Rust than Python would, but I'm almost certain Rust would still edge out Go.

I'm getting to the point where I'm almost as productive in Rust as I would be in either other language, and that makes Rust a no-brainer for me.

I'd like to respond by this and saying I'm porting a largeish codebase over to Rust for one purpose: I can embed it other languages, and I can into it from any language that exposes an FFI.

The goal is to move all business logic out of javascript on an nwjs desktop/crosswalk mobile app and move it to Rust. The interface would still be javascript, but the core logic (and crypto) would live in Rust. This gives me a portable core I can move between platforms, and in theory all that has to change is the UI (but not really, because in most cases the platforms run Javascript).

I don't think Go can be as easily embedded (because of its runtime) but perhaps I'm wrong.