5 ms·
This assumes that Rust is actually a better language. IMHO it isn't.
by uecker 2y ago
This assumes that Rust is actually a better language. IMHO it isn't.
- norman784 2y agoI would argue that in some sense it is, just because of the enforced safety and correctness.
- peoplefromibiza 2y agoSo it's Ada since 1980, before C++ was even created.
- sroussey 2y agoI wrote my first optimizing compiler for Ada in C++ around 1990.
- deleted 2y ago[deleted]
- uecker 2y agoIt does neither enforce correctness nor safety. It enforces memory safety in programs that stick to the safe subset. But don't get me wrong, Rust certainly has many good ideas and the focus on memory safety is good. I still do not think it is a great language.
- p2detar 2y agoI’m still unsure of how to feel about Rust. But if it has made it into the Linux Kernel, then I assume adoption is ongoing. Still, Zig seems somewhat more intuitive to me, even though I’ve used it as little as Rust thus far. A nice write up on the topic Zig and Rust: https://matklad.github.io/2023/03/26/zig-and-rust.html https://matklad.github.io/2023/03/26/zig-and-rust.html edit: typos
- deaddodo 2y agoGenerally Zig is going to be more intuitive for C developers (people who prefer more low-level and procedural style coding), while Rust would be more intuitive/conducive to C++ developers (those who prefer more abstractions and language level features/guarantees). Which is totally fine, there's a reason C++ never completely subsumed C; both are valid avenues.
- root_sleep 2y agoNot exactly sure about it myself either. There are things I like about it but at the same time there others that sort of bother me (uncertainty about whether the language will stick around, ugly syntax in certain cases). Being in Linux is impressive for a language, but I suspect most will stick to C.
- jltsiren 2y agoI think it's almost irrelevant how good Rust is as a language. Rust is winning in many contexts, because you can use it to replace C++, but the standard library and tools are substantially better.
- nostradumbasp 2y agoThe entire user experience is so much nicer that even if Rust was slightly worse I would prefer it. I don't miss header files, makefiles, not having a package manager, maintaining all the crazy code people wrote themselves as pet projects instead of using an existing project in an ecosystem. Thankfully its not worse, so I don't even have to weigh the odds.
- tomcam 2y agoWait isn't cargo a package manager? Not a rust expect so I'm probably missing something
- Tanjreeve 2y agoI think their point was that Rust has a batteries included package manager (cargo). Another advantage of which being that all rust projects are pretty standard in that particular aspect.
- nostradumbasp 2y agoThat is correct.
- amelius 2y agoWithout makefiles, how do you do projects with multiple languages or code generators like lex and yacc?
- nostradumbasp 2y agoWell, I don't use makefiles to deploy software with Rust. I also have never used lex or yacc, but I bet there are similar tools in the ecosystem, or wrappers for those. That would obviate what I will offer below. Often a new language in a project would define an application boundary. So those would be different containers or services. I may deploy via container images, or an OS specific installer, etc. If we aren't crossing an application boundary I may use FFI. Sometimes I use https://rust-lang.github.io/rust-bindgen/ https://rust-lang.github.io/rust-bindgen/ to smooth that over for C dependencies. There is also a nice concept called a build.rs file: https://doc.rust-lang.org/cargo/reference/build-script-examples.html https://doc.rust-lang.org/cargo/reference/build-script-examp.... There's also tools like: https://github.com/casey/just https://github.com/casey/just and https://sagiegurari.github.io/cargo-make/ https://sagiegurari.github.io/cargo-make/ I rarely use multiple languages with Rust. A lot of interpreted languages have bindings through crates and can go in to a project through Cargo (python, etc). If it involves JS/TS on desktop, I'm usually using Tauri for that. Guess it depends on the system? Hopefully that helps. You can also still use a Makefile if you want I just haven't dealt with one in a long time.
- 110jawefopiwa 2y agoI think the main problem is that Rust doesn't allow for basic data structures like graphs or doubly-linked lists without extra effort, which is why I've generally always preferred pseudocode.
- fpoling 2y agoWell, one can always emulate that in Rust with array indexes. And it will be closer how the actual CPU works where a pointer is just an offset into a memory chunk. Perhaps this is the reason performance oriented articles prefer Rust. In allows to skip a lot of memory allocation while still catching memory-safety bugs, which is a hard problem with C++.
- szundi 2y agoHow could something to implement a pointer be more straightforward than a pointer? People seem to like Rust in excessive, sometimes botheringly excessive proportions.
- deleted 2y ago[deleted]
- oconnor663 2y agoI don't think the indexing strategy is more straightforward in general. It's a thing you have to learn, and the fact that you have to learn it is part of Rust's famously steep learning curve. That said, there are some common cases where you might wish you'd used indexes instead of pointers in other languages too: - Working with resizeable collections like std::vector in any non-GC language, where resizing invalidates pointers. - Serialization. If your objects contain indexes to each other, it's easy to turn them into e.g. JSON. But if they contain pointers to each other, it's tricky.
- amelius 2y agoHow are you going to garbage collect inside your array? Sounds like you are just evading the problem and reinventing the heap.
- deleted 2y ago[deleted]
- matt3210 2y agoThe problem with rust is that it’s has lots of features but isn’t c like. Python doesn’t have much syntax so it’s fine to be not c like but rust has 100% new syntax and a lot of syntax with respect to c. I can pick up c like languages easy but rust just makes me mad to look at.