4 ms·
Can you elaborate on the underdiscussion of Rust as a byproduct of the C++ world? I'm into Rust, so I guess I assumed it was common knowledge that it was origi
by ragnese 6y ago
Can you elaborate on the underdiscussion of Rust as a byproduct of the C++ world?
I'm into Rust, so I guess I assumed it was common knowledge that it was originally written to be like OCaml with better concurrency, and that one of the early goals was to replace C++ in Mozilla code.
But, language-wise, I don't even see that much similarity with C++ except for the philosophy of zero-cost abstraction and the trivial syntax-style of generics being <>.
- cxr 6y agoI can elaborate, but first: are you a C++ programmer?
- bsaul 6y agoNot to throw a mean comment, but i think maybe it can help you in your life by giving you an external feedback : i hope you don't have this kind of attitude in real life, because it instantly makes you look like an pretentious prick and loose any credit. Your original comment made me curious, and this one loose any interest in what your point of view actually is. (fyi : HN is (mostly) a developer community with usually knowledgeable people working in the field. if you don't think explaining yourself here is worth it, i have no idea where you think you're going to have the opportunity to give your opinion)
- cxr 6y ago> i hope you don't have this kind of attitude in real life [...] you look like an pretentious prick Yeesh. I don't even know what attitude you're referring to. You've set out to give some life advice, but do you know how real life conversations work? Can you understand that my response will differ greatly depending on what the answer to that question is? It's pretty normal for dialogues to be... dialogues, which includes checking in with each other instead of monologuing based on a lack of shared agreement. > if you don't think explaining yourself here is worth it Once again, what are you even talking about? You're responding to something you've imagined I've said or something you want to attribute to me, not what I've actually said or am thinking. Can you wait for ragnese's reply and then my response before going off the deep end?
- cjaybo 6y agoFrom the guidelines: > Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith. Ironically, by assuming bad faith and a condescending tone in the comment you responded to, you've made a legitimately condescending comment.
- magic_quotes 6y agoPersonally, I think the put-down was quite on point. I don't see the point of flagging it, that just leaves the content to imagination.
- dang 6y agoAnyone can see flagkilled comments, or any [dead] comments, by turning 'showdead' on in their profile. Just be warned that most of what you'll see is comments by banned users. Occasionally we get emails from people who don't realize that and somehow assume that moderators are condoning the worst dreck that appears there.
- ragnese 6y agoI guess some other people here are assuming malintent with your question. Assuming that the answer might be condescending or dismissive depending on how I answer. I'll assume that's not the case and that you simply want to know so you can answer with relevant examples, etc. I did write C++ code for about 7 years. It was mostly C++98 and C++11. Since then I've also done a fair bit of Rust. I'm also very familiar with Swift, Kotlin, Java, some lisps, JS, Go, and a few others. So I have enough breadth in language experience for any compare/contrasts you'd like to do.
- cxr 6y ago> I'll assume that's not the case Thanks, that was actually the right answer! (And those assuming otherwise are not just getting the wrong answer, but I'll point out are breaking the rules[1] here, too.) The C++-to-Rust background is what I suspected—but the reason had nothing to do with being dismissive about not having the right buzzwords to prove you're smart and well-rounded. (This isn't a job interview, folks, geez.) My instinct was a presumption of deep familiarity. When I mention Rust having the marks of a being from the C++ world, I'm referring to a property of the language that it shares with Swift. When you say you don't see much similarity, my suspicion is that your first consideration is language semantics and the new affordances, and so when you think of Rust and C++, you're seeing foremost all the ways that they're different, rather than seeing the things that they share. I saw where Hejlsberg once said that he doesn't get why people draw comparisons between C# and Java, and then gives a list of reasons—where those reasons show that his main focus is similar, i.e. he focuses on the way that they differ (and maybe in his case, all the things that he "fixed" with C# in comparison). One of your sibling commenters writes that "Rust is an ML-family language dressed in a C-family syntax", but that's a little off the mark. Rust certainly has a C++-style syntax, but aside from curly braces, idiomatic Rust looks alien when compared to C. 1. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- ragnese 6y ago> When I mention Rust having the marks of a being from the C++ world, I'm referring to a property of the language that it shares with Swift. But what property is that? > I saw where Hejlsberg once said that he doesn't get why people draw comparisons between C# and Java [...] That's very amusing! > Rust certainly has a C++-style syntax, but aside from curly braces, idiomatic Rust looks alien when compared to C. For sure. But I'm still not sure why you say it's from C++ land. It's definitely more like C++ than C, but JavaScript is also probably more like C++ than C. That doesn't mean JavaScript is actually anything like C++, really. One thing that I thought of that Rust definitely does share with C++ (and C) that other languages (Swift) don't is that you don't have to decide at class definition if a type will be heap allocated or used as a reference vs value, etc. That's decided at the use-site.
- stevedonovan 6y agoRust certainly has C++ attitude to performance, for example 'zero-cost abstractions'. That precludes GC. But this is more indirect influence: targeting the same niche
- exrook 6y ago> That precludes GC This isn't the case, there are tracing garbage collectors implemented as libraries [1][2], and there is consideration being made for supporting tracing GC in the language and stdlib [0]. As well as reference counted GC having been available in stdlib for a long time [3] (similar to C++'s std::shared_ptr) [0] https://github.com/rust-lang/rfcs/blob/master/text/1398-kinds-of-allocators.md#the-gc-integration-strategy https://github.com/rust-lang/rfcs/blob/master/text/1398-kind... [1] https://manishearth.github.io/blog/2016/08/18/gc-support-in-rust-api-design/ https://manishearth.github.io/blog/2016/08/18/gc-support-in-... [2] https://boats.gitlab.io/blog/post/shifgrethor-i/ https://boats.gitlab.io/blog/post/shifgrethor-i/ [3] https://doc.rust-lang.org/std/rc/index.html https://doc.rust-lang.org/std/rc/index.html
- nicoburns 6y agoIt precludes pervasive or mandatory GC
- deleted 6y ago[deleted]
- celeritascelery 6y ago> I don't even see that much similarity with C++ except for the philosophy of zero-cost abstraction That is not really an explicit goal of C++, which is part of the problem rust is trying solve.
- crimsonalucard 6y agoThe term Zero cost abstractions, it is very much the goal.