Live data from Hacker News

Welcome to Comprehensive Rust

google.github.io

11–20 of 204 posts

Re: Welcome to Comprehensive Rust

#11

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

Could you point me towards a project where this is the case? I want to try it out as I never found Rust slow to compile.

Rust is most definitely slow to compile compared to GCC or LLVM for C/C++. This is a known situation and has been since the pre-1.0 days because of the heavily front-loaded macro and borrow systems. It's the tradeoff you have for having a "safe" language vs a "trusting" one.

I would argue that it's not as bad as it's made out to be, especially if you're not doing full recompiles and using it on modern (2019+) hardware; but it is a noticeable difference in similar large codebases.

Re: Welcome to Comprehensive Rust

#12
post #8

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

Slower compile times are a small price to pay for memory safety and much higher productivity.

Slow compile times can reduce productivity.

Re: Welcome to Comprehensive Rust

#13

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

Look into Apple silicon - lots of cache, great branch predictions, pointer-chasing prefetchers and more to subside just about all of your compiling worries.

Re: Welcome to Comprehensive Rust

#15

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

On the other hand, I've always found it surprisingly easy to dive into non-trivial rust projects and start contributing, at a speed that would be unthinkable in C or C++.

So I second the advise for non-trivial projects, they give a much better idea of the upsides and downsides of rust.

Re: Welcome to Comprehensive Rust

#16
post #3

Is this “just” a 20% project or is this more significant (like Android one day supporting Rust to develop apps)? And I haven’t looked at everything yet, but it suggests to install Rust like this: sudo apt install cargo rust-src While everyone I know uses rustup^: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ^ https://rustup.rs/

> Is this “just” a 20% project or is this more significant (like Android one day supporting Rust to develop apps)?

Android already uses Rust internally, in fact for new code it's a major language. They have made this guide to teach Rust to their engineers working on Android, according to this post on reddit: https://old.reddit.com/r/rust/comments/zrs1of/new_rust_cours...

Re: Welcome to Comprehensive Rust

#17

Earlier quoted context omitted.

Could you point me towards a project where this is the case? I want to try it out as I never found Rust slow to compile.

Rust is most definitely slow to compile compared to GCC or LLVM for C/C++. This is a known situation and has been since the pre-1.0 days because of the heavily front-loaded macro and borrow systems. It's the tradeoff you have for having a "safe" language vs a "trusting" one. I would argue that it's not as bad as it's made out to be, especially if you're not doing full recompiles and using it on modern (2019+) hardwar…

It's slower then C for sure. But slower then C++? I doubt it.

Re: Welcome to Comprehensive Rust

#19
post #13

The first thing I implore everyone to do when evaluating Rust is to check out a non trivial project and start hacking on it. I have always found the compiler to be unacceptably slow in these cases, especially if you come from C rather than C++. If you work your way up from Hello World you may not ever notice this until you already invested a substantial amount of effort.

Look into Apple silicon - lots of cache, great branch predictions, pointer-chasing prefetchers and more to subside just about all of your compiling worries.

Hmph, I wish…

Re: Welcome to Comprehensive Rust

#20

Earlier quoted context omitted.

Could you point me towards a project where this is the case? I want to try it out as I never found Rust slow to compile.

Rust is most definitely slow to compile compared to GCC or LLVM for C/C++. This is a known situation and has been since the pre-1.0 days because of the heavily front-loaded macro and borrow systems. It's the tradeoff you have for having a "safe" language vs a "trusting" one. I would argue that it's not as bad as it's made out to be, especially if you're not doing full recompiles and using it on modern (2019+) hardwar…

Rust macros are not the fault for its slowness. expansion is one of the fastest compilation phases. Time is rather spent in other steps like type checking, llvm optimizations and such. The issue is more Rust's generics as they cause a lot of code to be passed to llvm (among other issues for Rust's slowness).
Post reply on HN