3 ms·
> Rust is still too alpha to use for serious projects, and to be frank I find it carries much of the complexity that turns me off from C++ (I really wanted to l
by pcwalton 13y ago
> Rust is still too alpha to use for serious projects, and to be frank I find it carries much of the complexity that turns me off from C++ (I really wanted to like Rust).
Could you elaborate? I personally think that Rust carries no complexity that we didn't need to get the job done, and we're still simplifying the language (for example, removing conditions and glob imports), but I'm certainly open to hearing other ways that the language could be simplified.
> Nimrod is just as fast as D, and probably a bit faster than Go and Rust.
I think that for numerics all four languages will be roughly on par (although Go will be a bit slower if you're using 6g/8g, as they don't do much optimization), but for memory management the performance characteristics are quite different. Rust doesn't rely on garbage collection or reference counting for safe memory management, unlike all the others (although you can opt out in D, at the cost of safety). So I don't think you can really make an unqualified statement like that in all cases.
- jnbiche 13y ago>Could you elaborate? A major source of complexity, in my opinion, are the different pointers: owned pointers, managed pointers, borrowed pointers (mutable and immutable), each with its own syntax and rules for use. And all three seem to be everywhere. I actually understand pointers in C (mostly!), yet I struggle to remember all the use cases for pointers in Rust. Here's the tutorial on just borrowed pointers: http://static.rust-lang.org/doc/master/tutorial-borrowed-ptr.html http://static.rust-lang.org/doc/master/tutorial-borrowed-ptr... I'm sure I could understand learn the rules given some time, but now that I've played around with D and Nimrod, I'm wondering why I should. I can get excellent performance without using pointers, yet I can access a pointer if I absolutely need one. >So I don't think you can really make an unqualified statement like that. I agree that unqualified statements about the relative performances of language implementations are tenuous, and so I retract that statement. But it's clear that Nimrod can reach ballpark C++/Rust/Go speeds, even without GC specifically turned off, based on both my own usage and this benchmark: 1. http://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallel-go-rust-d-scala-and-nimrod/ http://togototo.wordpress.com/2013/08/23/benchmarks-round-tw... Now, it's quite possible that we're not getting optimal performance out of Rust because we're not writing idiomatic Rust, but this hurdle is at least partly a function of my first point. EDIT: I should add that I think Rust may well find itself in a very strong position among systems and embedded programmers, given the fine control and safety it offers. But for your average programmer just looking for a faster language to use when Python or Ruby won't suffice, Nimrod (and D with shared library support) is a very nice alternative.
- pcwalton 13y ago> I'm sure I could understand learn the rules given some time, but now that I've played around with D and Nimrod, I'm wondering why I should. I can get excellent performance without using pointers, yet I can access a pointer if I absolutely need one. Because they let you avoid garbage collection and data races while remaining safe. If you're just starting to use each language, then having just one, globally garbage collected type, will seem to make everything simpler. And benchmarks of numerics will show that hey, it doesn't seem to matter what your memory story is. But in my experience those who have struggled with garbage collection pauses or data races come to appreciate the ability to declare the ownership semantics at a fine-grained level. Large, production-quality, performance-critical software in Java, for example, very frequently starts running into issues with the garbage collector. And I don't think I need to go into the headaches of sorting out data races. Last I looked, Nimrod in particular loses all memory safety once you share objects between threads. (I hear this is changing though; I'm interested to see what they come up with.) Go loses some memory safety around maps and slices if GOMAXPROCS>1. D remains memory safe in @safe code, but at the cost of concurrent, stop-the-world garbage collection. None of these languages offer support for avoiding data races at compile time. Those decisions have real costs (as well as benefits; they're all tradeoffs). It's very easy to brush off features like safe manual memory management with "I don't need that feature in some other language, why would I need it here?" But everything you've posted has not indicated any understanding of why Rust has smart pointers. If you think GC, data races, or safety are not worth solving at a language level (which, to be clear, is a position that reasonable people can take!) then argue that instead of handwaving around pointer type complexity. I don't mind if you like Go/Nimrod/D better than Rust—they're all fine languages and I have great respect for their creators—but be informed with your criticisms. > But it's clear that Nimrod can reach ballpark C++/Rust/Go speeds, even without GC specifically turned off, based on both my own usage and this benchmark: This is a perfect example of how single benchmarks can be misleading. First of all, that benchmark was found to be mostly testing the performance of the random number generator, which is cryptographically secure by default in Rust and not in other languages. Second, that benchmark probably never even triggers the GC in any of the languages. It's totally numeric-bound. Try a benchmark of arena allocation, for example. Or compare max pause times.
- axaxs 13y agoIf I may, although not the OP. Rust feels heavy and complex from the get go. It has :, ;;, ->, and =>. It has multiple types of pointers, and constant defaults requiring mut. I could go on, but that's about as much as I could take. But why care about me, or people like me, perhaps I'm unique. It feels like Rust was designed for people as smart as the authors to use, and there's not a thing wrong with that. Myself, I prefer a small language that I can 'keep in my head', and build from there. With that mindset, Rust feels like a -very- complicated language, even at a glance. I hope Rust succeeds, as I'm a big fan of mozilla's mission, and appreciate all the work that you(they) do. But please don't take offense to the assertion that the language is pretty complex compared to Go, Ruby, Python, or C.
- pcwalton 13y ago> But why care about me, or people like me, perhaps I'm unique. It feels like Rust was designed for people as smart as the authors to use, and there's not a thing wrong with that. Myself, I prefer a small language that I can 'keep in my head', and build from there. Rust was not designed to be difficult. It's designed to be as easy as possible without sacrificing the goals of memory safety and data race freedom. Building on a foundation like those of those other languages would result in a language that isn't safe or uses global concurrent GC. > But please don't take offense to the assertion that the language is pretty complex compared to Go, Ruby, Python, or C. I think that Rust actually has simpler semantics and fewer special cases than all of those.