Hacker News new | ask | show | jobs
by financltravsty 874 days ago
> I was equally disheartened and delighted to later learn that the simple mental model I had for the cpu and memory were yet further from reality. Compiler optimizations, pipelining, branch prediction, out of order execution etc. were all fascinating and slightly terrifying things to learn about.

If you don’t understand the low-level/computer architecture, you will have a hard time learning Rust. It’s not a general purpose programming language like Ruby, JS, Python, etc. It’s a systems programming language meant to make the best use of the underlying hardware, like C++.

Learn CS first.

2 comments

I really don't agree with this. You don't have to pay any attention to low level concepts (unless you want to) except maybe the borrow checker? Which barely counts IMO. Scope and mutability are concepts every programmer should be familiar with. Ownership is a simple principle. You definitely can use it as a systems language. But you can use it for lots of other things effectively - and that fits my definition of a general purpose language.
Learning sole CS first is probably a good idea, but I don't agree with the reasoning. C++ exposes the underlying hardware to a large degree, and if you don't understand it, you'll be allowed to break stuff easily and before you know it. This is much harder to do in Rust. You don't need to know anything about function pointers, interrupts, registries, virtual tables, and what not, in order to follow the memory model. The unsafe parts, is a different story, so I suppose there is a limit. But Rust and C++ are fairly far apart imo.