Live data from Hacker News

Rust Lang in a nutshell

softax.pl

31–36 of 36 posts

Re: Rust Lang in a nutshell

#31

Earlier quoted context omitted.

This is by no means scientific, but it’s a fun benchmark, there’s some debate about the fastest Rust options submitted (ie I believe there were faster than C versions that were rejected). C: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Clang (for common llvm backend between rust and c): https://benchmarksgame-team.pages.debian.net/benchmarksgame/... C++: https://benchmarksgame-team.pages.debian.net…

On par is an understatement. It beats C++ in 8 benchmarks and loses in 2. Quite impressive. Rust has more potential for better optimisation than C++ because the compiler has full information on pointer aliasing.

Always look at the source code (or even the CPU load).

One of those C++ comparisons is currently multi-core vs sequential.

Several C++ programs were recently removed, which upends things. You might say — "there were faster than [Rust] versions that were rejected".

Re: Rust Lang in a nutshell

#32
post #31

Earlier quoted context omitted.

On par is an understatement. It beats C++ in 8 benchmarks and loses in 2. Quite impressive. Rust has more potential for better optimisation than C++ because the compiler has full information on pointer aliasing.

Always look at the source code (or even the CPU load). One of those C++ comparisons is currently multi-core vs sequential. Several C++ programs were recently removed, which upends things. You might say — "there were faster than [Rust] versions that were rejected".

One is multicore, but the other 7 winning have the same parallelism. As for that one winning by parallelism - maybe it was just easier to provide a correct parallel solution in Rust than in C++? This game didn't appear there yesterday and C++ developers had much more time to play it. If that's the case, that benchmark still counts.

Re: Rust Lang in a nutshell

#33
post #31

Earlier quoted context omitted.

Always look at the source code (or even the CPU load). One of those C++ comparisons is currently multi-core vs sequential. Several C++ programs were recently removed, which upends things. You might say — "there were faster than [Rust] versions that were rejected".

One is multicore, but the other 7 winning have the same parallelism. As for that one winning by parallelism - maybe it was just easier to provide a correct parallel solution in Rust than in C++? This game didn't appear there yesterday and C++ developers had much more time to play it. If that's the case, that benchmark still counts.

Maybe it was just that I contacted the Rust programmer and suggested they might like to update their program :-)

(The changes were in the last month or two.)

Re: Rust Lang in a nutshell

#34
post #23

If you are more of an interactive learner I would recommend installing rust on your machine and then cloning the rustlings repo https://github.com/rust-lang/rustlings . Rustlings is an interactive collection of rust exercises that are either incorrect or incomplete. The exercises are grouped into key concepts of rust and cross referenced with relevant chapters in the rust book https://doc.rust-lang.org/book/ The gene…

Having gone through rustlings while learning rust, I can say that apart syntax overview, they are almost useless. I was much more successful by studying the rust book while trying to solve/implement not completely trivial pet projects.

Do you mind sharing what kind of projects? Just in case you have a list laying around.

Re: Rust Lang in a nutshell

#35

Earlier quoted context omitted.

Having gone through rustlings while learning rust, I can say that apart syntax overview, they are almost useless. I was much more successful by studying the rust book while trying to solve/implement not completely trivial pet projects.

Do you mind sharing what kind of projects? Just in case you have a list laying around.

That would be something like:

* ToDo list with UI

* Stock Quote retrieval/analysis

* Toy VM/Interpreter

Re: Rust Lang in a nutshell

#36
post #23

If you are more of an interactive learner I would recommend installing rust on your machine and then cloning the rustlings repo https://github.com/rust-lang/rustlings . Rustlings is an interactive collection of rust exercises that are either incorrect or incomplete. The exercises are grouped into key concepts of rust and cross referenced with relevant chapters in the rust book https://doc.rust-lang.org/book/ The gene…

Having gone through rustlings while learning rust, I can say that apart syntax overview, they are almost useless. I was much more successful by studying the rust book while trying to solve/implement not completely trivial pet projects.

"Too many linkedlists" is an excellent tutorial for understanding ownership IMO.
Post reply on HN