|
|
Subscribe / Log in / New account

Not that hard

Not that hard

Posted Sep 3, 2024 10:41 UTC (Tue) by tialaramex (subscriber, #21167)
In reply to: WHAT? by rc00
Parent article: Rust-for-Linux developer Wedson Almeida Filho drops out

Nah, it's not that hard. It happened to be especially easy for me because I have decades of experience in semi-colon languages, especially C, and then also the First Language for my CS degree was the Standard ML of New Jersey, so all of Rust makes sense as it's essentially an ML disguised as a semi-colon language. So I'm the easy case, I barely remember "learning" Rust, much of it was like I'd always known this language.

Some top CS graduates will have a similar experience because both Cambridge and Oxford still begin with an ML as First Language and I expect at least a few of the decent CS courses in the US do as well -- beginning with a language that doesn't even have a proper type system makes the initial work of a non-vocational CS course very difficult to motivate.

But even if you've got a more vocational background where you learned like C++ and Python, or Java and Go or something, Rust's adherence to its "Empowering Everyone" slogan makes this a much softer landing that it might be. When you screw up (and you will screw up in any language) Rust will say that you screwed up, why and possibly even explain how to fix that.

In Java or Go you get inscrutable error messages. In Python the program blows up at runtime. In C++ your program - despite being complete nonsense - still compiles, and executes but doesn't do what you expected because it's wrong. What Rust is doing here maybe shouldn't stand out, but it does, and for some programmers this makes a huge difference.


to post comments

Not that hard

Posted Sep 3, 2024 14:48 UTC (Tue) by mb (subscriber, #50428) [Link] (2 responses)

That is correct.
Contrary to legacy languages the Rust compiler is your friend and guide when writing code and when learning to write code. It tells the programmer what is wrong, provides a hint and a link to detailed information about the problem and often also the actual fix for the problem.

And that process can even be turbocharged with tools like this:
https://crates.io/crates/bacon

Complicated and hard to understand compiler messages do exist in Rust, too. But they are very rare.

Yes, it takes a very long time to learn each and every detail of Rust.
But the same is true for C++ and even C itself.

But getting productive does not take weeks or months.

And learning Rust makes people better at programming in general.
Many concepts from Rust can be used in other languages, too. In fact, the kernel uses many of them already and many uses do predate Rust.
That reduces the step height for kernel developers even further.

I think it's much harder to come from the OOP-language side than from the C side when learning Rust, because OOP-thinking (inheritance) does not really work in Rust.

Not that hard

Posted Sep 5, 2024 12:09 UTC (Thu) by taladar (subscriber, #68407) [Link] (1 responses)

> Contrary to legacy languages the Rust compiler is your friend and guide when writing code and when learning to write code. It tells the programmer what is wrong, provides a hint and a link to detailed information about the problem and often also the actual fix for the problem.

Which is why, when someone claims that Rust is hard because you constantly have to "fight the compiler" you know they are doing something fundamentally wrong in their approach to the language, most likely not paying attention to what the compiler is trying to tell them because the transfer experience with other compilers to Rust where understanding most error messages requires significant effort.

Not that hard

Posted Sep 7, 2024 12:05 UTC (Sat) by khim (subscriber, #9252) [Link]

> most likely not paying attention to what the compiler is trying to tell them because the transfer experience with other compilers to Rust where understanding most error messages requires significant effort.

No, it's not that. Many (most?) developers these days act like “human ChatGPT”: they combine various pieces of code that look somewhat relevant to what they are trying to achieve (often with help of IDE or even, these days, LLMs), then they run the generated mess and when it, inevitably, explodes – they fix the most egregious bugs.

Rust blows that approach to smithereens: sure, compiler says that what you wrote is nonsense… and even shows some possible solutions… but you don't need all that, you need to make your program to run!

Disconnect can be pretty severe and both people who find Rust conceptually easy and people who find it hard often talk “past” each other.

P.S. Note: the fact that Rust is “conceptually” easy doesn't mean it's easy to learn to write programs in it. It's similar to snowboard, in some sense: incredibly easy and simple tool… yet one that requires quite a non-trivial amount of skill to use it. But linux kernel people are, actually, unique positioned to learn it, because many concepts that Rust enforces are, in reality, already in use in Linux kernel… only is come places there code that “violates it a tiny bit”… and Rust wants 100% compliance, not 99% compliance.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds