9 ms·
> a Manhattan Project to build a fast Rust compiler Or work on getting what Rust gives you in a different language that isn't Rust (maybe entirely new, maybe n
by cxr 6y ago
> a Manhattan Project to build a fast Rust compiler
Or work on getting what Rust gives you in a different language that isn't Rust (maybe entirely new, maybe not[1]).
One underdiscussed thing about Rust is that it's so clearly a byproduct of the C++ world. And the most disappointing thing about Rust is that it probably won't ever be seen as a prototype that should be thrown away.
1. http://mbeddr.com/ http://mbeddr.com/
- nilkn 6y agoRust is actually a byproduct of OCaml and to a lesser extent Haskell. This becomes obvious the more you use it, especially if you’ve written substantial code in either of those languages before. To really drive this home, I’d wager that you have a better chance of translating OCaml or non-fancy Haskell straight into Rust than you do C++.
- gnuvince 6y ago> I’d wager that you have a better chance of translating OCaml or non-fancy Haskell straight into Rust than you do C++. I found that translating OCaml code to Rust is frustrating, because you cannot easily and cheaply replicate the functional approach. It's much more Rustic to take an object by mutable reference and modify it in-situ than it is to take an immutable reference and return a new object. The reason is that in OCaml, you have structural sharing, i.e., multiple pointers pointing into the same data structure, which is a big no-no in Rust, so if you want to replicate the functional OCaml code, you begin allocating a new, complete data structure every time, and that's costly.
- nilkn 6y agoWell, of course. Rust is not designed around immutable data structures. There are going to be differences because it's simply not the same language. This [0] example, written by a notable Haskeller, illustrates what I mean pretty well and also touches on what you just pointed out. It's also very consistent with my own experience. [0]: https://donsbot.wordpress.com/2020/07/04/back-to-old-tricks-or-baby-steps-in-rust/ https://donsbot.wordpress.com/2020/07/04/back-to-old-tricks-...
- ragnese 6y agoCan 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?
- roca 6y agoIf you want to convince people that Rust should be thrown away in favour of mbeddr or something else, you need to make an argument based on specific design flaws of Rust, not just tar it by association with C++. That argument would have to not just explain why an improved language is needed, but also why Rust can't evolve into that language via the edition system. It would also have to convince people that whatever benefits the improved language brings justify moving away from the existing crate ecosystem, tool ecosystem, and developer pool, and building new ones (or how you would reuse/extend/coopt them). (In reality I think the influence of Haskell and even node.js were as important to Rust as C++.)
- cxr 6y agoFunny, before your comment showed up, I was actually going to edit in an addendum to link to https://robert.ocallahan.org/2018/10/the-costs-of-programming-language.html https://robert.ocallahan.org/2018/10/the-costs-of-programmin... ... to pair with the mbeddr link. You seem to be at a place where you think of Rust as already entrenched, but I'm at a place where I still see Rust as a proposition—one that could lead to that place, or not if we think better and nix it (following the reasoning above).
- loeg 6y agoI don't think Rust is going away. You may not like it; it may not be adopted by the Linux kernel. But it is widely used in real codebases (including, say, Firefox). It's not brand new. And the article linked above discourages creating new languages; valid or not, that horse is well out of the barn.
- cxr 6y agoThe post as written, and whether intended or not (admittedly by current signs, I guess it'd be foolish to wager anything other than "not"), ends with an observation that's still highly relevant here but that you're neglecting to account for. > I hope people consider carefully the social costs of creating a new programming language especially if it becomes popular, and understand that in some cases creating a popular new language could actually be irresponsible. And being widely used is not the same thing as being entrenched, not the same thing as being unable to say, "nice prototype; let's wrap this up now and do it for real this time".
- oconnor663 6y ago> And the most disappointing thing about Rust is that it probably won't ever be seen as a prototype that should be thrown away. Can that ever happen with a language that lots of people use?
- edoceo 6y agoJavaScript has entered the chat...
- pornel 6y ago• Rust is an ML-family language dressed in a C-family syntax to look palatable to existing systems programmers. It's a byproduct of the C++ world only to the extent that it has to work on the CPU architectures and operating systems influenced by C and C++. • Rust is mainly based on established research and existing languages from 80s and 90s. It's a distilled version of these, not a prototype. I recommend checking out the first pitch deck for Rust: http://venge.net/graydon/talks/intro-talk-2.pdf http://venge.net/graydon/talks/intro-talk-2.pdf
- umanwizard 6y agoRAII-based memory management without GC, and the concept of ownership vs. borrowing are very C++-inspired concepts. The borrow checker, which is the main innovation of Rust, is automated checking of things C++ programmers spend a lot of effort thinking about. I think the influence of C++ is much more than just the syntax.
- tjoff 6y agoMaybe that has more to do with almost everything new have been garbage collected for the last decades (and that is such a tragedy) and less to do with C++. It is a low-level programming language after all. Not being explicit about memory would be a bad thing (it almost always is).
- umanwizard 6y agoI was under the impression that RAII specifically (as opposed to manually calling malloc and free by hand) was an innovation of C++, but I could be wrong.
- tjoff 6y agoDon't know, but the concept is very useful and has found its way into many languages, such as thr using statement in C#. It is just that it is typically more useful/powerful in languages that lack a GC (doesn't necessarily need to be that way though, but my impression).
- d_tr 6y agoYou said two different things about Rust but you did not substantiate anything. What do you mean by "Rust is so clearly a byproduct of the C++ world"? Furthermore, in which way is Rust defective to the point that it should be seen as a prototype that should be thrown away? mbbeddr seems really nice and interesting but it is not just a language. It is a set of integrated tools around one. Rust shares goals with C++, i.e. it wants to be a high-performance and systems language like C++, but I find the differences to be quite substantial and worthwhile.