Learn Rust the Right Way
doc.rust-lang.orgLink is to "Defining Modules to Control Scope and Privacy" in The Rust Programming Language. Is that correct?
Sorry i meant to link the book not a specific module within the book.
Rust is becoming more important everyday that passes, so it might help to understand why.
I mean honestly my question is why should I bother ?
Java has memory safety and near native performance, the only thing going on for Rust is fearless concurrency which is a USP I think but not enough for me to bother learning its complicated syntax. Had I been unbelievably productive in that language, that would have sealed the deal completely. But alas.
It has good performance in a general sense. But what it really lacks is value types and good tools for cache efficiency.
That may not be important for what you're doing. But if it is, it's a huge pain in the ass to do on the JVM. For that reason, some people want to avoid Java altogether, not because it's slow, but because it has a lower performance ceiling.
But is that an argument against Java altogether? I don't think so. If your problem is solvable with sparse FFI, that is worth doing over throwing out a massive ecosystem you're familiar with. Value Types may yet come to the JVM someday, as ridiculous as that is to say now.
I think memory safety is a weak argument for rust and only works against C/C++, as you mention. For me, the strongest arguments against GCed languages are static analysis goodies that other languages don't have. Like checked immutably by the compiler, the borrow checker which forces you into a certain architecture, fearless concurrency etc. All those lead to fearless refactoring, which is a very strong point for me.
I was listening to a podcast (The Rust workshop, on Spotify " Jim and Tim go deeper into Rust and compare with ither languages") about Rust and the guest speaker said something similar to what you just said.
I don't like when people reference a part of a podcast without a timestamp. I've now listened to the whole thing, and I don't think they said anything of the sort. This was a bit of a clickbait comment.
They said C# was fast and has tools for optimizing. They don't mention Java at all, which makes sense, cause Java is lacking in the kind of optimization tools that C# has. Even so, they come up with a list of reasons why you would still want to use Rust.
It's odd that you would only mention them asking the same question as the commenter, and not their direct answers to that question.
I don't think Java has the same type of memory safety as Rust. Not unless things have changed drastically?
It doesn't, it merely disallows you from actually managing your memory.
please read my replies to the previous user. The podcast i mentioned has great topics that is educational. The two guys are very experience in their field, on of which was a C++ programmer.
Why not just give context? You referenced a 3 hour podcast with no timestamp. Is that 3 hours worth listening to, especially since this Podcast just does AI summaries now?
I left a sibling comment here on when you wouldn't use Java, I think that's a better place to start a conversation.
Rust has complicated semantics surrounding borrowing of course but its syntax is pretty straightforward I find! What makes you think it is complicated?