12 ms·
This pretty much mirrors my experience. Rust is the inverse of Perl: It makes the easy stuff hard. Writing basic data structures isn't a niche, esoteric edge c
by ok123456 4y ago
This pretty much mirrors my experience. Rust is the inverse of Perl: It makes the easy stuff hard.
Writing basic data structures isn't a niche, esoteric edge case. There may be a crate that "solves" what you're trying to do. But does it rely on the std---(i.e., is it unusable for systems programming)? Is it implemented making gratuitous copies of data everywhere? Does it have a hideous interface which will then pollute all of your interfaces? Does it rely on 'unstable' features?
Then, there's the 'community.' It seems to consist solely of extremely online people who get a dopamine hit from both telling people they're doing things wrong and creating the most complex solutions possible. They do this under a thin veneer of forced niceness, but it's not nice at all.
- ilrwbwrkhv 4y agoOn top of that Rust might be the ugliest modern language.
- coliveira 4y agoAgreed, using Rust is like switching a monster (C++) for another even worse. And notice that Rust is not even a mature language, it will get much worse. I will stay with C, thank you.
- ok123456 4y ago'constexpr' and 'auto' in modern C++ can eliminate a large portion of the ugliness. In some cases it can be much more ergonomic than the equivalent Rust.
- pjmlp 4y agoIndeed, one gets to write macro like code on the same language.
- spoiler 4y agoYou can write Rust macros in Rust too, if you wish, but it's a bit more involved (https://doc.rust-lang.org/reference/procedural-macros.html https://doc.rust-lang.org/reference/procedural-macros.html). I realise this isn't the same as constexpr, but I'd argue it's nicer. Rust also has const generics (but they are still a bit shabby in places last time I used them). I for one never liked the constexpr semantic and syntax. Always felt like a... Little pebble in my shoe. Didn't quite annoy me enough not to use it since it was useful, but it was never a comfortable experience.
- DeathArrow 4y agoAt least C++ is enormous and you can find a sane subset that you enjoy using. And C++ can be pretty safe with smart pointers.
- pjmlp 4y agoUnfortunately there is always that clever one than can't let go of writing C style code, regardless of what kind of pointers are being used. It is one of my favourite languages, but I also acknowledge that C compatibility is a big pain point for security.
- vore 4y agoThis almost works until you have to integrate with other people's C++ code and find out they picked a different subset to you.
- kaba0 4y agoCan you write a performant, generic vector data structure in C? Until then it is useless in my book.
- coliveira 4y agoSo useless that Linux, gcc, and all UNIX system commands is written in C. But you're probably doing much more important things, right?
- punkbit 4y agoWe should definitely appreciate the craftsmanship. This comment says everything, regardless of how trendy Rust might be, let’s respect the craft, your favourite language doesn’t make you more important. Legends!
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- kaba0 4y agoRust is not my favorite language and I didn’t mean to speak anything negative about projects written in C, but I do think that those that become great did so in spite of C, not because of it. No access to performant generic data structures is a major reason why truly performance oriented programs rather choose C++ over C.
- stouset 4y agoPeople keep saying this and I just do not get it. It's just… not that bad?
- ok123456 4y agoThe core language is fine, but when you actually start building things you need to introduce lifetimes, all the traits that you polluted your interface with and then add on async, it gets out-of-hand quickly.
- dimitrios1 4y agoThe top comment gave a perfect example: #![feature(strict_provenance)] These feature enablement blocks drive me crazy. You could go from codebase to codebase and it's almost like you are working in a different language depending on how many of these are enabled or not. I've been trying rust on and off since it's release, and I still have yet to feel like I have a grasp on some "core" subset of the language I can fall back on to solve most of my problems. I always have to scour documentation for the hot new thing to turn on or do, and this isn't to scorn innovation and change, but it does get exhausting at some point. (Please release a spec)
- satvikpendem 4y agoThose feature blocks exist only for nightly/unstable Rust. You don't have those on stable Rust. The most you might have are derive blocks but those just automate what you'd write by hand anyway.
- deleted 4y ago[deleted]
- Rusky 4y agoA spec is not a replacement for #![feature] attributes. It's rather the opposite: #![feature] indicates that you are stepping out of the stable, specified core language and into an area that is still a work in progress and thus cannot have a committed specification yet. You shouldn't need it at all unless you are actively experimenting with some unfinished proposal.
- edflsafoiewq 4y agoIMO Zig isn't exactly a beauty either.
- zamalek 4y agoThat is extremely subjective. I find the syntax extremely easy to read, and there are significantly fewer edge cases than nearly all other mainstream languages: * Why does C# require a break; under switch? * What about the "Most Vexing Parse"? * Why does Zig change capitalization of @import and @TypeOf? Rust is an extremely "guessable" language. It's highly likely that experimenting with syntax will succeed in Rust, which is a syntax feature that I have seen nowhere else.
- edflsafoiewq 4y ago> Why does Zig change capitalization of @import and @TypeOf? TypeOf returns a type. Corresponding to how type names are uppercase.
- somethingor 4y ago@TypeOf returns a type: https://ziglang.org/documentation/master/#Names https://ziglang.org/documentation/master/#Names
- Narishma 4y agoThat's entirely subjective. I personally find Zig, Nim and even Go much uglier than Rust.
- mustache_kimono 4y ago> Rust is the inverse of Perl: It makes the easy stuff hard. It's a bargain. Rust is pretty great, but it doesn't make some things easy because it would make everything else hard. This comment is amusing, mostly because Perl is so full of tradeoffs. Do you want to write something to do some string parsing quickly? Great language, maybe. Do you want to understand what you've written later? Maybe not so great. > Writing basic data structures isn't a niche, esoteric edge case. Not if you're using C, because the batteries are definitely not included. Want a resizable array, or hashmap? The answer is DIY. Not in the std library. Whereas all are provided by default in Rust. Picking a basic data structure off the shelf is a pretty nice feature for most applications. That said -- should you really need a custom implementation of a linked list, and you need to write and rewrite such an implementation all the time -- I'd understand if Rust wasn't your first choice. > Then, there's the 'community.' And I'm not sure anyone loves this attitude either. Keep it technical.
- ok123456 4y ago> And I'm not sure anyone loves this attitude either. Keep it technical. If I didn't include that proviso, I'd have someone arguing with me to the death about how I'm completely wrong and an idiot who doesn't understand the Correct Way of doing things.
- rat9988 4y agoThis is the same as people behaving as jerks claiming that other people are jerks.
- eldenring 4y ago> Writing basic data structures isn't a niche, esoteric edge case Maybe it isn't an edge case (although it should be) it also isn't `easy` in a non GC'd language, and a huge source of memory bugs. I wouldn't say it makes the 'easy stuff hard' as much as the 'hard stuff appropriately difficult'.
- adamrezich 4y agowhy should writing a basic data structure be an edge case? …what?
- TheCoreh 4y agoAll of the "basic" data structures are already provided by either the standard library or crate ecosystem, so you'll rarely (if ever) need to write your own linked list or hash map from scratch. I say "basic" in quotes because once you factor in the concurrency, ownership and memory safety concerns that are optional in other languages, but mandatory in Rust, there really isn't a simple implementation of these structures that is provably correct anymore.
- GrumpySloth 4y agoRust is supposed to be a systems programming language. If writing basic data structures was an edge case in it, the language would be broken. Luckily, in my experience it isn’t (at least not in this way).
- adamrezich 4y agoI'm glad you posted this, I was confused as to whether "basic data structure" meant something different to Rustfolk than it did to the rest of us.
- DeathArrow 4y agoWriting data structures is trivial in C/C++.
- hgs3 4y ago> It seems to consist solely of extremely online people who get a dopamine hit from both telling people they're doing things wrong and creating the most complex solutions possible. I've observed that certain programming languages have a culture of complexity. I'm not sure why this is. I can only speculate its because these programmers are working on "boring" problems so they make busy work for themselves OR their beginners who think this is how "real programmers" work. While I think calling them "idiots" is a bit strong, I think this quote from the late Terry A. Davis is worth remembering: “An idiot admires complexity, a genius admires simplicity [...] for an idiot anything the more complicated it is the more he will admire it, if you make something so clusterfucked he can't understand it he's gonna think you're a god cause you made it so complicated nobody can understand it.”
- ok123456 4y agoTerry would have probably used a word stronger than 'idiots'.
- doodlesdev 4y agoInsanely enough, he was quite lucid (at least compared to other live-streams) when he said this quote, so no n-words there. [0] [0]: https://youtu.be/k0qmkQGqpM8 https://youtu.be/k0qmkQGqpM8
- kaba0 4y agoI don’t know, people who go too hard on simplicity often don’t even grasp the underlying problem in a given case (looking at this utterly dumb piece of text as an example: http://harmful.cat-v.org/software/ http://harmful.cat-v.org/software/) - sure, no sane people would want to deliberately introduce complexity/abstractions, but abstraction is the only weapon we have against complexity. Problems have an inherent complexity which simply cannot ever be reduced. If you do have to make it work, what else can you do? I think go is a good example for this fallacy, it claims that it is a simple language, but ad absurdum asm should also be trivial to understand as every line is also easy to grasp, right? Low expressivity just creates chaotic complexity, won’t reduce it.
- xxpor 4y ago>Writing basic data structures isn't a niche, esoteric edge case. It very much should be though! That's exactly the type of thing that should be written once by someone who knows what they're doing, and then reused 1000000 times. People slapping together a quick data structure is a huge problem in C.
- loeg 4y ago> [Rust] makes the easy stuff hard. I totally disagree with that claim. The easy thing to do is not use unsafe Rust. You can use stringly-typed datastructures with lots of refcounting or copying, just like Perl, without ever venturing into unsafe Rust. > Writing basic data structures isn't a niche, esoteric edge case. There may be a crate that "solves" what you're trying to do. But does it rely on the std---(i.e., is it unusable for systems programming)? In what world is Perl suitable for systems where possible memory allocation is a problem?
- Karrot_Kream 4y agoOne technical criticism I have of the "community" is that a non-trivial portion of the community thinks that if the borrow checker forbids a program then the program is a bad program. None of the core contributors do this and many prominent library authors are upfront that this is not true, but I've read lots of comments and posts in Rust rooms about how the borrow checker should be the way to write and architect correct programs. The Rust borrow checker imposes a style that is safe, but is not the only safe way to write that program.
- dathinab 4y ago> Writing basic data structures isn't a niche, esoteric edge case writing data structures _properly/well_ was never easy it just looks easy and is nearly always a sub-par solution e.g. a list in many lisp like languages seems simple, until you look under the hood what magic tends to be used by more advanced compilers to make that list work fast the think people most commonly got wrong which was supposedly easy when programming when I was school/stadium where data structures, even comparatively simple ones like double linked lists it's like sorting, sure you find docents easy to implement sorting algorithms everywhere, but then when you look at the properly implemented sorting build ins of standard libraries their complexity is hundreds of times that of quick sort or similar
- pjmlp 4y agoThere is already C for when one wants to do otherwise.
- nextaccountic 4y ago> It makes the easy stuff hard. > Writing basic data structures isn't a niche, esoteric edge case. Writing basic data structures isn't "easy stuff" in any low level language. It isn't in Zig by any means, nor in C nor in C++