News for hackers. Stuff that matters.
Re:Tour of Rust by marvinblum on Sunday July 12, 2020 @07:05AM (#23810492)
From what I've heared, Go compiles much faster than Rust. But I'm only experienced in Go...

[Edit] I mean you could just install Rust, copy the samples and run them locally?

Re:Tour of Rust by bouncycastle on Sunday July 12, 2020 @07:16AM (#23810535)
Yes, I've noticed the Rust compiler does fancy stuff like check for similarly named constants, check constants have uppercase names, do static analysis to check that I've kept my immutable variables immutable, check that a semicolon is always at the end, and so on. I've never found those necessary in Go...
Re:Tour of Rust by estebank on Sunday July 12, 2020 @11:38AM (#23812121)
Most of these are written in such a way that they don't affect the happy path and if they do their pact is negligible. Are you saying that these checks are completely unnecessary, or are you saying that you'd prefer a faster compiler over one with more checks?

Also, we perform many, many more checks beyond the ones you've mentioned, for example https://play.rust-lang.org/?version=nightly&mode=debug&editi... :)

Edit: To expand on "don't affect the happy path": most of those extra lints, checks and suggestions will be performed only if the error condition has been met. If your code doesn't trigger a mutability error, or a missing identifier error (to take from the parent's examples) the searches for suggestions are never executed. For others like style lints, those add some time to processing, but they are linear in time, we tag things that miss a lint during parsing or other passes and then emit them later.

Re:Tour of Rust by oconnor663 on Sunday July 12, 2020 @09:09AM (#23811054)
The bigger costs as I understand them, are that everything needs to get passed through LLVM, and that the widespread use of generics increases the amount of generated code that passes through LLVM.
Re:Tour of Rust by ATsch on Sunday July 12, 2020 @09:24AM (#23811134)
Last I heard, the biggest source of compile time in rustc is emitting absolutely enormous amounts of LLVM IR and leaning on aggressive low-level LLVM optimisation passes to clean things up. There are efforts to make most of these optimisations earlier that have been landing in recent releases, but I'm not sure what the overall state of it is.
Re:Tour of Rust by swsieber on Sunday July 12, 2020 @09:56AM (#23811310)
I they have started doing work on that? I can't recall what it was exactly, but there was one constant or number (I'm so good at being specific) related one that did the optimization on the rust side instead of on LLVM's side.
Re:Tour of Rust by steveklabnik on Sunday July 12, 2020 @10:19AM (#23811453)
Re:Tour of Rust by ylyn on Sunday July 12, 2020 @07:37AM (#23810595)
Those are negligible in terms of compile time.
Re:Tour of Rust by bouncycastle on Sunday July 12, 2020 @08:50AM (#23810940)
Indeed. I suspect this is just the tip of the iceberg?