News for hackers. Stuff that matters.
Re:Rust at OneSignal by pjmlp on Thursday January 05, 2017 @04:27AM (#13325872)
Still has a bit of catch up to do, compared with what I enjoy daily in Java and .NET projects.

Right now my biggest pain, are the compilation times, specially seeing cargo compiling multiple times the same crates instead of reusing the already binary compiled libraries.

Unless there is some magic cargo incantation I am missing.

Re:Rust at OneSignal by EugeneOZ on Thursday January 05, 2017 @04:30AM (#13325885)
Cargo doesn't recompile all crates on each iteration, you are missing something definitely. It only recompiles changed code. Or if rustc/cargo version has been changed.

"a bit of catch up" is one thing, not mentioning most powerful IDE plugin is another.

Re:Rust at OneSignal by pjmlp on Thursday January 05, 2017 @05:25AM (#13326072)
This is not what I see, I imagine you are talking inside one single project, while I mean across all Rust applications I might have available.

1 - Get Project A

2 - Crate X gets compiled as one of the dependencies

3 - Get Project B

4 - Crate X gets compiled again as one of the dependencies

I usually see this when compiling all the VSCode related projects during new Rust releases.

Could the reason be that Crate X on Project A and Project B isn't the same version?

Where are the binary rlib visible to all cargo projects stored? I could only find text versions zipped together.

I haven't checked this deeply yet, just seeing "Compiling crate X" multiple times isn't fun.

Re:Rust at OneSignal by steveklabnik on Thursday January 05, 2017 @09:55AM (#13327515)
We don't do any of this kind of caching because flags can be different per-project. There's an open bug on it; it's not impossible, we just haven't used it yet.
Re:Rust at OneSignal by pjmlp on Thursday January 05, 2017 @11:32AM (#13328489)
Same applies to any language that compiles to native code or has support for conditional compilation.

Even with MIR, Rust will never compile faster than C or even C++ if dependencies on binary libraries aren't supported.

Right now I can compile my C++ projects on Windows, and .NET Native ones, faster than when updating Rustfmt, racer and Rustsym, after each new Rust release.

VS2017 will bring the new linker, and the ongoing MS work for C++ modules (now a TS).

Rust won't win the hearts of C++ developers if it doesn't allow for binary dependencies, and doesn't compile faster.

Re:Rust at OneSignal by EugeneOZ on Thursday January 05, 2017 @05:31AM (#13326094)
All projects are independent and binaries are stored in "target" folder. It's a good thing. Even libs nominally same versions can have different source code and dependencies (because of "replace" or vendoring).
Re:Rust at OneSignal by pjmlp on Thursday January 05, 2017 @05:44AM (#13326137)
No, it is not a good thing. It is a waste of my development time that I could use for productive work.

On other AOT compiled languages that I use at work, I can reuse binaries across projects, including the languages Rust intends to replace.

It is a hard sell, if using Rust means having to spend more time compiling than even with C++ (specially now that modules are finally coming, at least for us with VC++).

Re:Rust at OneSignal by EugeneOZ on Thursday January 05, 2017 @06:05AM (#13326228)
For me is a good thing, because, as I explained, version number is not a guarantee.
Re:Rust at OneSignal by pjmlp on Thursday January 05, 2017 @06:44AM (#13326372)
So, than cargo needs to be improved so that there is a set of dependency values (name, version, rustc version, etc) that can guarantee the uniqueness of a binary library.

To me it seems FOSS undervalues the value of binary libraries in the enterprise, or how they get used in many corporations or companies selling components.

Rust improved safety is a good thing™, but not at the expense of continuously seeing the same libraries being compiled over and over, vs reusing binary artifacts across projects.

Re:Rust at OneSignal by EugeneOZ on Thursday January 05, 2017 @07:24AM (#13326569)
Cargo needs to be improved, here I agree :)
Re:Rust at OneSignal by p0nce on Thursday January 05, 2017 @06:28AM (#13326310)
dub (D build tool) support both of these locations. I can attest stuff gets reused.
Re:Rust at OneSignal by icebraining on Thursday January 05, 2017 @07:48AM (#13326687)
It doesn't have to use the version, it could hash the source, like ccache.
Re:Rust at OneSignal by fjrieiekd on Friday January 06, 2017 @08:47AM (#13336139)
Needs better build support, CI testing and better tooling to match C++ on mobile.