Go vs. Rust: Productivity vs. Performance (2014)
joshitech.blogspot.com
joshitech.blogspot.com
(Furtherfurtherfutherfurthermore, why are we still comparing Rust to Go? I thought we had gotten over this!)
Correct. Which is why, unlike Rohit Joshi, the benchmarks game simply shows a broad median; and when a summary measure is required to order the box plots, uses the geometric mean:
http://benchmarksgame.alioth.debian.org/u64q/which-programs-...
(Note the reminders -- "Please don't obsess over tiny differences in median values from such a small number of examples." -- "Please don't obsess about which programming language implementation is shown 10th and which is shown 11th. You can see that the order would be different if it was based on the median scores instead of the geometric mean scores.")
>>as though any of its microbenchmarks measure anything other than "is this language capable of binding to libpcre" or "is this language capable of binding to libgmp"<<
Incorrect. Everyone can see that there is only 1 regex task and only 1 arbitrary precision arithmetic task -- and they sensibly allow library use.
Firstly because they are a sort of marketing: I've perused the shootout before and noticed an implementation get a higher score than I was expecting. This has sparked an interest in digging deeper into that implementation/language.
Secondly because of the "can't even" problem i.e. why should I invest time investigating a new language if it can't even do simple benchmarks well? I appreciate that this isn't a particularly analytical view but I expect that it's not uncommon.
This also isn't an utter dismissal of the concept of microbenchmarks, it's an utter dismissal of the concept of microbenchmarks as used to compare language implementations. Something like the TechEmpower web framework benchmarks is at least marginally better because the tasks permit a wider variation of implementations and at least pretend to do some kind of useful tasks, instead of pretending to be an arbiter of implementation quality (which, as much as the benchmarks game disclaims it, is still what people take it as).
Evidently the level of effort to contribute a working Rust spectral-norm program is too high for anyone ;-)
>>pretending to be an arbiter of implementation quality (which, as much as the benchmarks game disclaims it, is still what people take it as).<<
The benchmarks game is "just 10 tiny examples."
> Evidently the level of effort to contribute a working
> Rust spectral-norm program is too high for anyone ;-)
Or they just don't care and refuse to let the benchmarks game hold their free time hostage. :PNo thanks, Go offers no benefit over the Java eco-system, neither in terms of deployment[0][1][2], not in terms of libraries and dependency management, nor in language expressiveness (Java 8, Scala, Clojure, Kotlin, Ceylon, Groovy)
[0] http://www.excelsiorjet.com/
[2] http://www-01.ibm.com/support/knowledgecenter/api/content/SS...
EDIT: Also forgot to add that we enterprise devs also have C#, F#, Swift, C++14, C++/CX at our disposal
I see one clear benefit right there.
Almost all commercial JVMs do support AOT compilation.
Plus we are talking about the enterprise here, those values are peanuts in project budgets.
Also don't forget to add "developer time * cost per hour" writing repetitive code in Go to your price.
I have found Rust to be considerably more expressive than Go. Traits and proper generic types, iterators and pattern matching all contribute to this. I tend to write less lines of Rust code to accomplish the same tasks.
As for runtime performance, in my experience they are pretty close right now for my use cases but I do expect Rust to grow faster than Go over time.
Out of interest, what would I gain by learning GO? I already know Python pretty well. I have done Java in the past and don't see any problem jumping back into it. Both languages have tons of libraries and tooling available. Are mature, and I can't see much reason to opt for a new language.
A significantly easier deploy story. Compile once on your target platform (i.e. Ubuntu), run on any of the same platform, without having to worry about installing (or how to install) all of your third party dependencies.
It's also more friendly to less skilled developers, with its type system and limited metaprogramming.
It also has a really compelling concurrent programming paradigm which doesn't involve libraries or pickle.
Of course, those same strengths are also weaknesses - the language is less expressive and flexible, and it requires extra steps to compile and distribute those compiled binaries.
People choose platforms, stacks, languages, environments, not languages: Rails not Ruby, browser not JavaScript, Unix not C, host not Cobol, ...
Also Fortran is getting a new standard revision this year.
http://research.microsoft.com/en-us/projects/concurrentbasic...
I am glad that there is servo but we need something like an operating system (IoT might work for the start). I hope Samsung changes its plans with Tizen and eventually will develop something with Rust in mind.
Just listing some of the issues, from my point of view, Rust currently faces.
It is not there if one is looking for uses cases where GC performance doesn't matter e.g. Haskell, OCaml, .NET, JVM. All existing alternatives enjoy more mature libraries, editors, supported OSes and so on.
It is not there if the goal is to replace C++ on the mobile platforms, as it introduces hurdles and increases the development time versus using the vendor tooling.
Specially in the iOS and Windows Phone, where C++ is a first class language. A kind of Objective-Rust, Rust/CX are needed there, even if rustc is able to cross compile.
On Mac OS X it is not there in regards to Swift tooling and available libraries, additionally for many developers ARC and GDC might just be good enough, even if Swift is less safe than Rust.
You don't need unsafe code to make any data structure in Rust. Cycles can be made just fine using std::rc::Rc. The fact that it uses `unsafe` blocks under the hood doesn't mean it's not memory-safe. You seem to be vastly misinformed about what memory safety means.
You can make cycles without Rc, of course.
Here is a post by pcwalton on the same subject: https://news.ycombinator.com/item?id=9095314.
In any case, part of the point of Rust is the ability to write safe abstractions over unsafe code. Arguing that the data structures like vectors are not memory safe is identical to the argument that other languages' runtimes are not safe.
I didn't say you said that, I gave an example of a useful thing you can't do in Rust. It is very meaningful to say that Rust isn't practically memory safe if you have to resort to unsafe code a lot of the time, or pay performance costs. I'm not talking about data structures like vectors, by the way. And it's not just data structures themselves, it's what you can do with them on the outside.
Obviously you can make pretty much whatever abstractions you want in Rust if you use some GC'd heap or allocate stuff in vectors and use indices instead of pointers. But if you're doing that, you're probably going to not be doing it for long, there's a reason you aren't using Java.
Web tech is just the simplest way to reach the end user. Mobile apps or desktop apps are becoming a hassle as well. It just takes time to "install" something and use it.
I hope thing change but I am skeptical.
https://www.reddit.com/r/programming/comments/374mre/we_just...
https://www.reddit.com/r/rust/comments/2xvtll/getting_acquai...
https://www.reddit.com/r/rust/comments/387ucr/question_are_e...
Having met them for lunch a few weeks ago, I can confirm that this project is still going strong. :)
EDIT: And if you were asking for the names of any startups using Rust, our next SF meetup has the theme "Rust in Production", with presentations by Tilde, MadeSafe, Ironworks, and Terminal.org: http://www.meetup.com/Rust-Bay-Area/events/222260315/
https://github.com/frankmcsherry/timely-dataflow
https://github.com/frankmcsherry/differential-dataflow
Nothing much useful to contribute, except that they mostly work, are largely unsafe-free (unsafe in some sorting, and a Drain replacement), and build on 1.0 stable.