Rust vs. C++ Benchmark Game
benchmarksgame.alioth.debian.org
benchmarksgame.alioth.debian.org
A more accurate comparison? A different comparison would be against clang.
The benchmarks game might well be described as "a good starting point" http://algs4.cs.princeton.edu/faq/ but let's not confuse that with some kind of definitive final analysis.
(Edit: Say what you disagree with, don't just down vote.)
See also Rust vs Haskell: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
And Rust vs Go: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
Specifically, i'm currently hesitating between golang and rust for coding a small Websocket chat server. I'm ready to use beta code because rust seems more promising to me in the long term than golang, but not if the language itself has severe fundamental limitations on server side programming.
Go's concurrency features are nice if it's your kind of thing, but will get in your way when hitting that "last mile" of performance. For example, if you were to implement something like haproxy, you would probably want to use Rust over Go for performance.
When I saw this decision my first reaction was "Well, that was a promising language. Shame about that." I can't be the only one...
Also, it doesn't _preclude_ green threads. As others have mentioned, Rust is low-level enough that all of this is a library issue, not a language issue. You can write whatever concurrency primitives you need, and they'll be no less privileged as the ones the standard library gives you.
Additionally, for a variety of reasons Rust's tasks were not smaller than OS threads, because they need to be bigger for a lot of things (calling into C, for example) and segmented stacks were found to be much too slow. Go gets around these problems by allocating a new stack when the current one runs out of space, but doing that properly requires being able to trace all the pointers into the stack to figure out where to transfer them--in other words, it requires a garbage collector :) So that solution wasn't really viable for Rust.
Finally, having to support both concurrency models required Rust to make significant sacrifices in its libraries, in both complexity and performance. Go was able to make the decision to focus entirely on green threading, but Rust did not take that approach, so it was stuck in a "worst of both worlds" situation.
It is possible that there is a better solution that avoids all these problems, but it will have to be found outside the main Rust tree.
[1] https://github.com/TechEmpower/FrameworkBenchmarks/pull/1101
But the reality of concurrency and hardware is that all we have at the end of the day are threads anyway. So in Rust you could have a thread running an event-loop that serves your web sockets. People are building these sorts of abstractions for Rust but they are a work in progress as far as I know. MIO[0] is one such example.
Rust is a programming language for systems programming and "server side programming" is just a subset of systems programming.
I want to add that stability in deciding to use a language in an application is very important. How good the standard library is and how much traction the language is gaining in projects and particularly open source projects is also important.
For use outside of production it seems okay. There are two Sinatra/Flask/Express style web frameworks (Nickel and Iron), a browser engine (Servo), a game engine (Piston) actively developed. So if you have interest in any of those or interest in implementing something like that you might be able to make your project shine. Also really nice on your portfolio if you ever want to get a job where Rust is already in use.
Or one just has fun with it. :D
(From what I understood, Rust gives you similar control over memory allocation as [a sane subset of] C++, so intuitively it should come out relatively close)
https://pay.reddit.com/r/rust/comments/2jm4vq/rust_0120_vs_c...
How is rust when it comes to deployment. C++ is a real pain to deploy for large projects. Compilation setup is also a massive headache in c++.
https://webcache.googleusercontent.com/search?q=cache%3Ahttp...
http://benchmarksgame.alioth.debian.org/play.html#languagex
If you have a linux install the benchmarks game scripts should work fine, and you'd probably get help from the D community --
http://forum.dlang.org/thread/lv7h1r$mg3$2@digitalmars.com?p...