Hacker News new | ask | show | jobs
by pjmlp 1586 days ago
I get the same feeling, Rust seems to be going down the path of "#[feature]" collection.
2 comments

Rust feature flags aren't the same as Haskell feature flags. In Haskell you design your own programming language by selecting which extensions to enable. In Rust, feature flags only exist on the unstable nightly compiler and either get folded into the language proper or deprecated and dropped entirely. It's not a combinatorial explosion of interacting extensions, it's a single base for everyone that grows over time.
Oh, those features, you are talking about stuff that is included/excluded in libraries. Those have nothing to do with compiler extensions, they don't change the language.
Indeed, perhaps it was bad to name this (er) feature of Cargo with the word "features", since it invites conflation with the unstable #[feature] attribute of nightly Rust, but it has nothing to do with the language.
It shares that as well as horrendous compile times with Swift.
The irony being that while C++ is known for its compile times, the ecosystem relience on binary libraries makes it much more tolerable.

Microsoft is also shipping pre-compiled projections for Rust/WinRT.

Then we have examples like image, that compile rayon twice, with different versions, because we just love to watch third party crates being compiled.

However I should also add that compile times have improved greatly, my travel netbook can finally handle small Rust projects without killing the battery.

C++ binary libraries are a disaster. At least Rust is honest and tells you to just fall back to the C ABI for interop, and rebuild high-level abstractions around it in code that's built with the project - much like a 'header-only library' in C++.
I beg to differ, and until Rust community acknowledges they are relevant, there are industry domains where C++ will keep its dominance.
Take a look at the C++ community discussion around the feasibility of "ABI breaks". The C++ community is acknowledging the issues, and how they're getting in the way of continued "dominance" in many sectors.
I am fully aware of them, a vocal minority that only cares about FOSS libs.

Why do you think Apple has spent such a big effort making Swift work for shipping binary libraries?

Most devs would just stick with Objective-C, C and C++ otherwise.

> Microsoft is also shipping pre-compiled projections for Rust/WinRT.

Eh, sort of. They're basically shipping the Rust equivalent of C header files and import libraries. Whereas before they would parse metadata in a build script which would then generate the Rust code on the fly (which was hell for a number of reasons). And the installed Windows SDK was used for the import libraries.

Nope, I was speaking about this,

https://github.com/microsoft/windows-rs/tree/23ff38bbbf46fb5...

Apparently since last November they decided to replace it with another approach, so my information is outdated.