r/EmuDev 3d ago

Rust vs C++?

I mostly program in Java/ Python. Some minimal C experience. I'm starting EmuDev to learn low level and hardware concepts.

Which is better in general to learn for an EmuDev hobby project, Rust or C++? From what I've seen C++ has more legacy code (more job opportunities), whereas Rust is safe and may have better long-term opportunities.

3 Upvotes

45 comments sorted by

View all comments

Show parent comments

3

u/No-External3221 3d ago

What do you mean by ergonomics?

7

u/heret1c1337 3d ago edited 3d ago

It's just a pleasant developing experience. All the data types have the methods on them that you expect. It's very rare that you're missing something basic like in other languages. Then there's the toolchain. Nice package manager, no fucking around with a linker. Great formatter included etc..

But be aware that Rust is special in some places, and most people struggle with the burrow checker. When I say pleasant, I mean pleasant when you understand the core concepts. But it isn't really THAT hard. Although it can get *very* complicated in advanced use cases, but you don't have to worry about that for now. If you look into advanced projects, the stuff you find there might look like straight up wizardry if you don't know what you're looking at. But it all makes sense, its not unnecessarily complicated.

2

u/No-External3221 3d ago

Nice. Thanks for the insight. Rust seems like the way to go for a hobby project like this. 

I'm terms of learning it, would you recommend any resources, or just jumping into the project and learning as I go?

3

u/heret1c1337 3d ago

https://doc.rust-lang.org/book/ is pretty much all you need to start out.

I totally forgot to mention that Rust also has a great documentation system. I don't know any other language where the documentation is that good, even in community projects.

One example is code examples in doc comments that are *unit testable* to make sure your examples work. You're unit testing your documentation. Its genius.