7 ms·
Andrei Alexandrescu, one of chief architects of D answered this a while ago on Quora [1]. IMO, this is a fair and nuanced answer. [1] https://www.quora.com/Whi
by FraaJad 10y ago
Andrei Alexandrescu, one of chief architects of D answered this a while ago on Quora [1]. IMO, this is a fair and nuanced answer.
[1] https://www.quora.com/Which-language-has-the-brightest-future-in-replacement-of-C-between-D-Go-and-Rust-And-Why?srid=hyT https://www.quora.com/Which-language-has-the-brightest-futur...
- k__ 10y agoHehe, I saw a talk with the creators of Rust, D, C++ and Go. No one of the "older" fellas even knew the Rust guy and I don't even know anymore who he was, was it Hoare? Maybe. C++ was about "We get things fixed, I promise!" D was about "We get shit done!" Go was about "We are good enough!" Rust was about "We try new shiny things!"
- kbenson 10y agoI'm not under the impression that all that much of what Rust does, besides borrow checking, is necessarily all that new. Aren't most the other things from other languages that have used them to good effect?
- k__ 10y agoTrue story. But look at the functional stuff. I mean how much of this is really in broad use? Yes at the moment there seems to be a functional renaissance, but before that 90% of the programmers around the world tought of stuff like Haskell or OCaml as crazy academical experiments.
- kibwen 10y agoWhat "functional stuff" are you referring to? I don't consider Rust a particularly functional language, other than the fact that it has closures and the ability to `map` over iterators. And if closures and `map` are your benchmarks for functional stuff, then Python, Javascript, and Perl have been doing functional stuff for decades now. :)
- nv-vn 10y agoThere is quite widespread use of monads in the standard library (albeit with a very targeted effort to hide their nature and make them very concrete).
- kibwen 10y agoCan you give an example? I can't think of anything in the Rust standard library that I consider a "monad".
- nv-vn 10y agoIterators are monadic (since they have a flat_map method), Option and Result have the and_then method. Both of these are equivalent to >>=/bind. The fact that they don't implement pure/return doesn't change the fact that they have monadic interfaces because that would only be useful once it was generalized to its own trait, and such a function would be trivially implemented for any of these types. For example, Some(x) works as the return/pure function for Option and the fact that the name differs for each type is not an issue because there's no way to make code generic over all monads as it is. It would be like having a unique trait for each type where there's `bind_option` and `bind_result`, etc.
- kibwen 10y ago`Option` et al may have vaguely monadic interfaces, but don't you need `return` in order to satisfy the monad laws? Regardless of what we determine there, I don't think that matters in the broader context of this thread, which concerns the notions that Rust has the potential to scare people away by including unfamiliar "functional stuff". But seeing an `.and_then` method doesn't scream "functional programming"; method chaining has been long popularized in Javascript, Ruby, etc. Furthermore, AFAIK there's nothing about Rust's pseudo-monadic interfaces on iterators that hasn't already been popularized by LINQ in C#.
- pjmlp 10y agoI guess I belong to those 10%. My first FP language was Caml Light in 1995, I was doing "LINQ" in Smalltalk on that same year and Prolog on 1996. Sadly not all CS degrees are how they should be.
- steveklabnik 10y agoOne of the reasons that "Rust" is the name is that Rust _doesn't_ try things that are "new and shiny." Or rather, it depends on where you come from: coming from the PLT perspective, many of the ideas in Rust are pretty old, but if you come from industry, they seem very new. (Also, the person who was in the video you're talking about was Niko Matsakis, not Graydon. And it was August 2014, so, so much has changed with Rust since then.)
- k__ 10y agoI see, thanks. Well, I don't know about how long any of these "ideas" were around somewhere buried in academia. What counts is that Rust tries things differently than Go, D or C++, so it's "new" in terms of an "implementation in broader use" I think you guys are going the right way :)
- makoConstruct 10y agoYo I came across a comment you made a while back asking whether there was a scripting language that does rust-like lifetime checking. That thread's archived now so I have to tell you here, it exists https://github.com/pistondevelopers/dyon https://github.com/pistondevelopers/dyon I don't really see the point, personally. But you seemed to really want it so
- Youk2016 10y agoWell, it's OK for a short reply on a forum. > 10x better theorists. Of the three, Rust is the only language with world-class PL theorists on roster. This can be seen in the precise definition of the language and the depth of its technical approach This argument impressed me. I'm sure Walter Bright does account for a fair share of D's popularity, though, so I take the 10x to mean in numbers :)
- nv-vn 10y agoIsn't Rust's syntax technically more Algol-like than C/C++/Go/D are? Anyways, I don't think it's worth calling that a disadvantage, at least with the way it's stated. I think "high learning curve" is a lot more accurate in this circumstance. And I'd disagree that the syntax serves no purpose, I think it's specifically designed to reinforce the notions of Rust's programming style (for example, implicit returns because Rust code is designed to always return something instead of using void functions). I'd be surprised if the syntax didn't help shorten code in at least a few places.