←back to thread

451 points birdculture | 1 comments | | HN request time: 0.199s | source
Show context
cyber1 ◴[] No.43982539[source]
"Safe" Rust is generally a simple language compared to C++. The borrow checker rules are clean and consistent. However, writing in it isn't as simple or intuitive as what we've seen in decades of popular systems languages. If your data structures have clear dependencies—like an acyclic graph then there's no problem. But writing performant self-referential data structures, for example, is far from easy compared to C++, C, Zig, etc.

On the opposite, "Unsafe" Rust is not simple at all, but without it, we can't write many programs. It's comparable to C, maybe even worse in some ways. It's easy to break rules (aliasing for exmaple). Raw pointer manipulation is less ergonomic than in C, C++, Zig, or Go. But raw pointers are one of the most important concepts in CS. This part is very important for learning; we can't just close our eyes to it.

And I'm not even talking about Rust's open problems, such as: thread_local (still questionable), custom allocators (still nightly), Polonius (nightly, hope it succeeds), panic handling (not acceptable in kernel-level code), and "pin", which seems like a workaround (hack) for async and self-referential issues caused by a lack of proper language design early on — many learners struggle with it.

Rust is a good language, no doubt. But it feels like a temporary step. The learning curve heavily depends on the kind of task you're trying to solve. Some things are super easy and straightforward, while others are very hard, and the eventual solutions are not as simple, intuitive or understandable compared to, for example, C++, C, Zig, etc.

Languages like Mojo, Carbon (I hope it succeeds), and maybe Zig (not sure yet) are learning from Rust and other languages. One of them might become the next major general-purpose systems language for the coming decades with a much more pleasant learning curve.

replies(1): >>43982560 #
make3 ◴[] No.43982560[source]
"raw pointers are one of the most important concepts in CS" that's a reach and a half, I don't remember the last time I've used one
replies(2): >>43982724 #>>43987510 #
wepple ◴[] No.43982724[source]
The concept of being able to reference a raw memory address and then access the data at that location directly feels pretty basic computer science.

Perhaps you do software engineering in a given language/framework?

A clutch is fundamental to automotive engineering even if you don’t use one daily.

replies(4): >>43985428 #>>43985862 #>>43989010 #>>43992757 #
1. vacuity ◴[] No.43985428[source]
I think Java pointers wouldn't count as raw pointers despite having many similar characteristics.