Re:Cross-platform Rust rewrite of the GNU coreutils
by andrepd on Tuesday March 22, 2016 @02:36PM
(#11338799)
Don't underestimate performance. I haven't seen the most recent benchmarks, but C/C++/Fortran are still unbeatable in raw speed. If you want maximum performance no matter what, these are the languages to choose, even if they sacrifice readability, maintainability or safety.
[ Parent
| on HN ]
Re:Cross-platform Rust rewrite of the GNU coreutils
by jfoutz on Tuesday March 22, 2016 @03:03PM
(#11339071)
Well, rust is beating g++ in the benchmark game now. [1] (please don't take microbenchmarks seriously) Performance is complicated, rust has a couple of things going for it that will help out a lot. First, there's a pretty strong bias to use the stack. As opposed to java or scheme where stuff is heap allocated by default. Second, rust avoids the pointer aliasing problems of c and c++. When someone gets around to making a fast matrix library, it'll likely take much much less time to catch fortran than c++ took.
But again, performance is complicated. People have put tens of thousands of hours into c/c++ optimization. rust is young, so not so much time there. On the upside, rust has room to grow.
https://benchmarksgame.alioth.debian.org/u64q/which-programs...
Re:Cross-platform Rust rewrite of the GNU coreutils
by igouy on Wednesday March 23, 2016 @12:33PM
(#11345954)
Take microbenchmarks seriously as true statements that such & such measurements were made of particular programs.
Please don't generalize that into language X is beating language Y.
Re:Cross-platform Rust rewrite of the GNU coreutils
by steveklabnik on Tuesday March 22, 2016 @03:05PM
(#11339091)
If equivalent Rust code is significantly slower than C or C++, it's a bug. Please file them if you find them.
Re:Cross-platform Rust rewrite of the GNU coreutils
by _ph_ on Tuesday March 22, 2016 @02:47PM
(#11338909)
That is, in this general form, wrong. Most compiled languages can match or sometimes exceed C speeds, depending on the task at hand and the algorithm chosen. There are a lot of very inefficient C programs around - because they are badly written. More high-level languages allow the programmer to focus on speed where it matters. And in the current day and age, there should be no reason to favor raw speed vs. program correctness and safety.
Re:Cross-platform Rust rewrite of the GNU coreutils
by nwmcsween on Tuesday March 22, 2016 @03:12PM
(#11339161)
You see code size and linearity is very important for anything non-trivial and hot. New languages tend to have abstractions built upon themselves making understanding and optimizing a pain.
Re:Cross-platform Rust rewrite of the GNU coreutils
by _ph_ on Tuesday March 22, 2016 @03:50PM
(#11339472)
Well, I have plenty experience of working with SBCL which directly gives you access to the assembly produced, allowing extremely good control of the code quality in hot spots. Just
(disassemble 'my-function)
would give a nice printout. There are also lots of other languages, which might be high-level, but still give you excellent code quality - I used Modula-2 a long time ago which did back then beat the resident C-compiler in generated code quality. Yes, many C compilers are very good and some new stuff not much so, but claiming in general that "C" is fast is an oversimplification.