5 ms·
(Have [mostly embedded] rust experience, only dabbled in go) > Is D ever a better choice? When? Probably not, very small community, few resources, etc. … > W
by danhor 6y ago
(Have [mostly embedded] rust experience, only dabbled in go)
> Is D ever a better choice? When?
Probably not, very small community, few resources, etc. …
> Why do we act like you can only pick one, when IPC and FFI and microservices mean you can split the difference if a language is only best for a portion of your project?
FFI is a huge pain and pretty slow in golang if not already done for you.
IPC & microservices do have a lot of overhead, so you probably don't want use it for e.g. your text parser. It also makes it harder to use established knowledge in another language.
> If I'm starting greenfield, when should I pick C++ over Rust?
- Do you have experienced C++ developers/are you one?
- Is your environment geared for C/C++ code, e.g. kernel modules or RTOSes, maybe game development?
- Do you have dependencies that strongly expect you to use a certain language, e.g. QT or (less so) GTK? Might be a pain to use with Rust
> If I'm looking at C++ alternatives, how would I choose between Rust and Golang?
- Rust is more speed/correctness focused while Go feels a bit like a faster scripting language. So something that might have started in python is probably a better match for go (a webserver, something script-like)
- Go really isn't meant for constrained environments (although there do exist solutions) like small linux IOT devices or even bare-metal stuff,
I feel like Go & Rust are pretty good complements and while you can do a lot of things with both, they are clearly very different. For some examples, with what I'd recommend, not necessarily what I'd use, since I do have a huge fondness for Rust, not so much for go
- Normal web backend: Go
- High performance web server: Rust
- DB: Rust
- App server: Go
- Crypto (the non-money kind) stuff: Rust
- WASM (it's pretty embedded-like): Rust
- bachmeier 6y ago> > Is D ever a better choice? When? > > Probably not, very small community, few resources, etc. … Have you used both? Not seriously, I'm going to say, or else you wouldn't say something like that. As one example - one reason you'd be looking for a C++ alternative is to interact with existing scientific computing codebase written in C. Good chance you won't care about all the stuff that gives Rust the steep learning curve, and you don't want to mix weird symbols all over your code. I used Rust first, then moved to D. There's no way someone used to programming in C is going to feel more comfortable with Rust than with D. (They might still choose Rust, but there's just no way they'd do it because of comfort.)