3 ms·
> It's almost never "we just don't have to care" when comparing to most other popular languages. Struggling with Haskell type system is not an experience of so
by youerbt 2y ago
> It's almost never "we just don't have to care" when comparing to most other popular languages.
Struggling with Haskell type system is not an experience of somebody who has developed an intuition about Haskell type system. Granted, it is not a binary thing, you can have good intuition about some parts of it and struggle with others.
I think they way you put it is, while technically true, not fair. Those "most other" languages are very similar to one another. It is not C# achievement, that you don't struggle with its type system coming from Java.
This is like people struggling with Rust because of burrow checker, well, they have probably never programmed with burrow checker before.
- SkiFire13 2y ago> burrow FYI it's "borrow" (as in when someone lends something to you) not "burrow" (which is a tunnel/hole)
- withinboredom 2y agoI struggled with the borrow checker because I’m smarter than it is, not because I haven’t worked with one before. Mainly I say “I’m smarter” because I’ve worked on big projects without it and never had any issues. Granted, I’ve only gotten in a fight with it once before giving up on the language, mainly because it forced me to refactor half the codebase to get it to shut up and I had forgotten why I was doing it in the first place.
- tinco 2y agoDid you rewrite the code base into C++ to avoid the borrow checker?
- withinboredom 2y agoNo, I just stopped contributing to the project and never touched Rust again.
- maleldil 2y ago> I’m smarter than it is Given how many important projects maintained by smart people have dealt with bugs that safe Rust makes impossible, I'm inclined to doubt that.
- withinboredom 2y agoIn my particular case, I was absolutely sure it was safe without having to test it. Would it remain so forever? Probably not because software changes over time.
- eddd-ddde 2y agoIn those cases what you are supposed to do is write your logic using unsafe, and wrap it with lifetime safe APIs. That way your "smartness" joins efforts with rusts, and not-so-smart people can use your APIs without having to be as smart.
- nyrikki 2y agoLet's be realistic, rust is great, especially compared to C. But it shifts the need to memorize undefined behavior with the need to memorize the borrow checker rules. If you are dealing with common system level needs like double linked lists, rust adds back in the need for that super human level memory of undefined behavior, because the borrow checker is limited to what static analysis can do. IMHO, the best thing Rust could do right now is more clearly communicate those core limitations, and help build tools that help mitigate those problems. Probably just my opinion, and I am not suggesting it is superior, but zig style length as part of the type is what would mitigate most of what is problematic with C/C++ Basically a char myArray[10];, really being *myArray is the main problem. Obviously the borrow checker removes that problem, but not once you need deques treeps etc... If I could use Rust as my only or primary language, memorizing the borrow checker rules wouldn't be that bad. But it becomes problematic for people who need to be polyglots, in a way that even Haskell doesn't. I really think there's ways for Rust to grow into a larger role. But at this point it seems that even mentioning the limits is forbidden and people end up trying to invert interface contracts, and leak implementation details when they're existing systems are incompatible with the projects dogma. It is great that they suggest limiting the size of unsafe code blocks etc....but the entire world cannot bend to decisions that ignores the real world nuances of real systems. Rust needs to grow into a language that can adjust to very real needs without and many real needs will never fit into what static analysis can do. Heck C would be safer if that was the real world. I really do hope that the project grows into the role, but the amount of 'unsafe' blocks points to them not being there today, despite the spin.
- deleted 2y ago[deleted]
- ggm 2y agoGood intuition is a gift from god. For the rest of us, notational confusion abounds. Types are great. Syntax (not semantics) and notation can be a major bummer. I think use makes master: the more you use it, the more mastery you will have and the better intuition will follow.