4 ms·
In fairness, I don’t think rust in web dev makes any sense outside of personal hobby projects. I’m not surprised there’s lots of abandoned and unfinished proje
by mr_00ff00 4y ago
In fairness, I don’t think rust in web dev makes any sense outside of personal hobby projects. I’m not surprised there’s lots of abandoned and unfinished projects there. That’s not an important area.
- satvikpendem 4y agoFor backend APIs it absolutely makes sense, not only for the safety guarantees but also its type system which makes data flows much easier to reason about. I recommend the book Zero To Production in Rust in particular for learning about this, I finished it recently and at the end I had a production-ready backend API. https://zero2prod.com https://zero2prod.com
- mr_00ff00 4y agoRust isn’t as safe as GCed language and you don’t need systems level speed on a backend API. Rust’s safety is better than C/C++, but memory vulnerabilities are found in cargo packages because of unsafe code.
- satvikpendem 4y ago> you don’t need systems level speed on a backend API. I do, actually. > but memory vulnerabilities are found in cargo packages because of unsafe code. Forbid unsafe in your config and you're good.
- mr_00ff00 4y agoCorrect me if I am around, but Forbid unsafe does not include dependencies, which can and do have unsafe rust.
- satvikpendem 4y agoYou can use cargo-geiger to check whether dependencies have unsafe code too, along with your own code.
- Dylan16807 4y ago> Rust isn’t as safe as GCed language Safe rust should be. And C# is a notable example of a GCed language that also has 'unsafe'. Along with most of the GCed languages with FFIs.
- mr_00ff00 4y agoSafe rust can still use crates with unsafe rust, so no. Unless it’s safe rust and uses no outside code or none of its dependency tree has unsafe rust. It’s pretty crazy how many people will argue this point and downvote comments about it. It’s like a C++ dev claiming they never write memory bugs. I love rust, but the community pretending like memory safety bugs are impossible is as annoying as people claiming memory safety isn’t important. EDIT: And GC languages “can” call unsafe is not the same as a language that has unsafe in it. It’s laughable if you are claiming there are the same memory bugs in say Elixir as there are in Rust.
- Dylan16807 4y ago> Unless it’s safe rust and uses no outside code or none of its dependency tree has unsafe rust. If you already know what you want, why pretend there is no solution? But you skipped the other half of the post, where I explained that the average GCed language either has unsafe code or can easily call unsafe code or both, just like Rust.
- mr_00ff00 4y agoIf you are doing web backends, you are using crates with unsafe code. Again, I could write C code without memory violations hypothetically the same way I could use no crates, so I guess all rust rewrites are no longer necessary? As I said in the edit, GC languages are safer than an unsafe language like rust, even if you could find and call unsafe code. Again, I don’t know why to someone that uses rust I need to make that point. If a C++ dev argued using C++ is fine cause all GC languages can call unsafe code, would you agree? Cause if you do then we might as well end rust now, it’s not adding any safety. All language are unsafe!
- 4y ago
- dgb23 4y agoThis is a good book. Very hands on and goes all the way.