4 ms·
Can kind of say the same about Rust. Benefits aside, it's hard to imagine a more hostile language. Is it the language or the idea of the language people are thr
by bE9a3S5So8igd3 6y ago
Can kind of say the same about Rust. Benefits aside, it's hard to imagine a more hostile language. Is it the language or the idea of the language people are thrilled about?
- jhasse 6y ago> [...] it's hard to imagine a more hostile language. C++?
- bE9a3S5So8igd3 6y agoHostile, but not more. C++ isn't completely unlike every other language people have been using for decades.
- HideousKojima 6y ago>C++ isn't completely unlike every other language people have been using for decades. Neither is Rust, most of the things that seem weird or new in Rust already exist in functional languages.
- wwright 6y agoI heavily disagree, as someone who uses C++ as my primary language at my job for the last three years, and who has a lot of experience in many other languages. It has developed a lot of idiosyncrasies that range from "confusing unique syntax" to "using these two features together will blow your app up with no warning from the compiler".
- tene 6y agoI'm very confused by this claim. Rust's borrow checker is new, but everything else in the language is extremely familiar and recognizable to me from other languages I've worked with. Structs and enums are all over the place Free function definitions, and methods defined on a data type, are extremely common Rust Traits are ways of naming groups of operations to be associated with different types, and share a lot of similarity with Type classes, roles, interfaces, mixins, etc. present in many common languages async/await is similarly present in many common languages Generics / Parametric Polymorphism, extremely familiar from C++, Java, C#, etc. It's almost all modern takes on normal common PL things that have been in many languages for decades So by my perspective, I see a very normal imperative language, with its own take and small quirks on very familiar features, and the only feature I've been able to come up with that's "completely unlike every other language people have been using for decades" is the borrow checker. One new unique feature seems well within the weirdness budget of a new language. Could you expand a bit more on what it looks like from your perspective? What other features or properties of the language seem strange, alien, foreign, or otherwise completely unfamiliar to you?
- sanderjd 6y agoIt totally is unlike every other language... I can't think of any other language that has rvalue references or move semantics or template metaprogramming or all sorts of other stuff that C++ has in order to pull off its zero-cost abstractions. For other things, like RAII and desctructors, the only language I know that has the same concepts is Rust. I agree that Rust has some things (maybe just one thing: the ownership + borrow checking system) that are "completely unlike every other language people have been using for decades", but so does C++.
- mcintyre1994 6y agoIt's the language. If you go into the detailed results here: https://insights.stackoverflow.com/survey/2020#most-loved-dreaded-and-wanted https://insights.stackoverflow.com/survey/2020#most-loved-dr... that most loved is described as "% of developers who are developing with the language or technology and have expressed interest in continuing to develop with it."
- ryuukk_ 6y agoresults doesn't make sense most participants are web devs, and yet a system language is most loved? it doesn't make sense, many other details doesn't make sense at all
- nicoburns 6y agoI couldn't disagree more. I didn't find the borrow checker rules that hard to learn: they all seemed pretty sensible and intuitive (and I came from a JavaScript background, I hadn't done any low-level programming before). And all the little details of the language are wonderful: Enums, Traits, expression-orientation. It makes for a very expressive language.
- Thaxll 6y agoDepends, a simple hello world yes maybe then you start working on some more complex structure that are trivial to do in any other languages but you will fight hard in Rust, I invite you to look how GUI things are implemented in Rust. Even some simple sharing can be a pain and counter intrutive. I would add that tooling and stability are also not a thing for Rust as of now, that being said it's pretty clear that Rust is here to stay like Go.
- rhn_mk1 6y agoComplex structures are easier to get right in Rust than in mosy other languages, because the compiler railroads you into a subset of possible solutions that work correctly. That being said, those structures are a subset of all possible structures and may feel roundabout. Sharing does end up being even less obvious, but it also steers you away from bugs which would be difficult to spot in other laguages. I think it comes out even here.
- neutronicus 6y agoI confess I do find C++, warts and all, more expressive than Rust. There are little conveniences in Rust like switch / if being expressions and the ? operator, but the gimped Templates and refusal to do Implicit Conversion wind up littering boilerplate everywhere. I do somewhat prefer the way its standard library handles iterators, though.
- entha_saava 6y agoPeople are quite attached to technologies these days.
- estebank 6y agoCould you expand on what you have found hostile about the language? Is it its syntax, semantics, development experience, ecosystem or maturity?
- bE9a3S5So8igd3 6y agoMostly syntax and semantics. Programming with Rust is unlike anything else, at least unlike anything else I've used. Despite the apparent effort they put into making great error messages, I don't think manual lifetime management is something a typical programmer will pick up very quickly. Most of the other languages on the list, I imagine one could be productive relatively quickly. I have myself proven empirically that for not utterly-trivial programs, Rust isn't something one "picks up," due to layers of novelty. To be repetitive, my take is that benefits aside it's got to be the most hostile language currently achieving popularity.
- caditinpiscinam 6y agoSomething that I've found confusing in Rust: the fact that the return type of a function call seems to depend on how the returned value is used. This thread [0] has the following example, where the statements: let v: Vec<u8> = b"3q2+7w==".iter().cloned().collect(); and let v: HashSet<u8> = b"3q2+7w==".iter().cloned().collect(); are both valid, even though both statements have the same expression on the right hand side. In a language like Java you could assign a value to different types based on a sub-type / super-type relationship (Object foo = Arrays.asList(...)), but that's not the case here, nor is it the case that Vec<u8> and HashSet<u8> have the same layout in memory. Instead, according to the thread, the result from collect can be interpreted as any type that implements the FromIterator trait. I don't know what the name for this sort of behavior is, and I haven't seen it in other languages. Perhaps it's just a property of Rust's trait system? Regardless, it feels intuitive to me - like the compiler is taking type information and using it to make implicit casts throughout the program. Not a huge impediment - just something I found confusing that isn't related to the borrow checker. [0] https://users.rust-lang.org/t/why-cant-the-compiler-the-type-of-an-iterator-collect-call/13707 https://users.rust-lang.org/t/why-cant-the-compiler-the-type...
- 6y ago