News for hackers. Stuff that matters.
Re:Two years of Rust by comex on Monday May 15, 2017 @04:39PM (#14344910)
Rust's compiler is not fast. At best it can beat C++ compilers - C++ being a language whose build times people love to bemoan - but usually it does far worse. This might change once rustc eventually gets proper incremental compilation (not the codegen-only thing that's currently in beta). Hopefully. Rust doesn't use header files, so in theory it should be possible to leapfrog C++ (at least until C++ gets modules standardized), but for now that's just theory.

Right now, I don't do much serious work in Rust, almost solely because of compilation speed.

Re:Two years of Rust by brandur on Monday May 15, 2017 @05:38PM (#14345350)
I was partly relying on the context offered by the article and my parent comment to imply that sure, Rust's compiler isn't the fastest in class, but the team has identified speed as a major outstanding problem and is working very actively to address it.

Compilers are pretty hard. Languages like C and Go are able to short circuit the problem by having a simplistic type system, but the Rust team's main option here is hard work, and so far they seem to be more than willing to engage in it.

> At best it can beat C++ compilers - C++ being a language whose build times people love to bemoan - but usually it does far worse.

Citation needed on that one. How can you even make that kind of comparison fairly?

Re:Two years of Rust by nickpsecurity on Monday May 15, 2017 @07:17PM (#14346060)
It's one of those things that's happened to so many people with so many C++ compilers on projects of any significant size that almost everyone says it. Happened to me with several where I moved from a Pascal-like language to find the compile time terribly slow even when I barely used the language. A lot of it is do to how the language's syntax, semantics, and esp templating are designed. Plenty of languages with even more flexibility compile faster than C++ due to better design.
Re:Two years of Rust by brandur on Monday May 15, 2017 @09:29PM (#14346722)
Oh totally agreed that C++'s compilation times are (quite infamously) a mess. I think that my parent was asserting that Rust's compile times are "usually ... far worse" (the "it" in the quote above is a reference to Rust).

For all I know, that might be true, but it's one of those "citation needed" type things.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:03AM (#14347676)
Personal experience.

It takes me about half an hour to update rustfmt, racer and rustsym, every time a new Rust release comes out. On a dual core with 8 GB and HDD.

On the same computer, any of my VC++ 2015/2017 builds, configured to take advantage of incremental compilation and linking, using forward classes and PIMPL idioms, with all third party dependencies already available as binary dependencies, takes around 5 minutes.

Lack of incremental compilation and cargo not being able to deal with binaries dependencies has putted me off, after all if I want slow builds I can have them already in C++ when I go template meta-programming craziness, which are not that slow when using the experimental work Microsoft is doing with C++ modules.

Also since our use of C++ is constrained to libraries used from Java/.NET/Android/iOS, the build times are usually relatively fast.

Hard to sell Rust to anyone on the team, if that means their workflow would become slower, in spite of the safety improvements over C++.

Re:Two years of Rust by MaulingMonkey on Wednesday May 17, 2017 @03:08PM (#14361779)
If my github api-fu is correct that's what, 40kloc for the rust side of things? Doesn't seem unreasonable times (vs C++) for a full rebuild on that machine - which I'd generally want to do for anything but the most trivial C++ toolchain bump too (in fact, I'm usually forced to) making a comparison against incremental builds very apples-to-oranges IMO. What's your C++ LOC/full rebuild like?

I'm used to ~100kloc of C++ taking half an hour per config+platform on a 4-6 core, 16GB+, SSD machine. Less hygenic than your codebase sounds like, but with some beefy PCHs. Toolchain updates are usually a full day affair in this context, although that's not entirely from just the compiler bump.

Of course, incremental vs full rebuilds are no contest. Rust is at least working on incremental builds now that they have MIR AFAIK. And binary cargo support would be really nice as well. As would be compiling in general.

Re:Two years of Rust by oblio on Tuesday May 16, 2017 @02:36AM (#14347792)
Well, as you said, C++ had a ton more effort poured into the toolchain, at this stage.
Re:Two years of Rust by nickpsecurity on Tuesday May 16, 2017 @12:47AM (#14347427)
Maybe I misread as I quickly moved through the thread. It does look ambiguous now. All I'll claim is horrible compile times on C++. I'm not sure where Rust is at now.
Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:07AM (#14347685)
On personal projects sadly slower than C++ equivalents.

But I do take advantage of all VC++ improvements for fast C++ compilation, even playing around with the ongoing research work for C++ modules.

Re:Two years of Rust by nickpsecurity on Tuesday May 16, 2017 @02:23PM (#14351998)
How does it compare to the free C++ compilers in building large projects like you described in other post on 30 vs 5 min?
Re:Two years of Rust by vvanders on Monday May 15, 2017 @05:32PM (#14345305)
Oh please, it's plenty fast, at least on par with javac. There's also 'cargo check' which is blazing fast.

If you're seeing very large compile time then it's a good sign that you probably want to break things into smaller crates anyway. I've been working on some pretty large stuff and compile speeds haven't been an issue(aside from the Emscripten linker, but that's not Rust's fault).

Re:Two years of Rust by hyperpape on Monday May 15, 2017 @06:21PM (#14345684)
Is this based on benchmarks? I don't have any, but I can do a clean compile of 8000 java classes (> 2 million lines) in 3 minutes on my underpowered Mac mini.

I wouldn't expect Rust would ever be as fast to compile, even if it weren't a younger language, because Rust is doing compile time optimization that Java defers until runtime. And that's ok: there may be times what Java does is better, but there are also times it's worse.

Re:Two years of Rust by bluejekyll on Monday May 15, 2017 @07:04PM (#14345985)
`cargo check` is pretty darn fast, and that's pretty much all you need while developing. I'd say it's generally 50% faster than a standard compile (not benchmarking, just a gut feeling).

On top of that `cargo watch 'test'`, runs fine on a 100kloc project, way better than my personal experience with Java. Now, when Rust compiles all dependencies from the ground up it is really slow, but that's only generally one time during development or after updating dependencies.

For me, the compile times are fine, and the end product generally doesn't need as much debugging as an interpreted language that requires no compilation at all, or has minimal validation, prior to running.

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @12:42AM (#14347411)
That assumes you're using cargo and it's "fuck the package manager" approach.
Re:Two years of Rust by bluejekyll on Tuesday May 16, 2017 @02:10AM (#14347696)
Cargo is a development and build tool, and it's quite possibly the best I've ever used. I don't know of any specific reason it's "fuck the package manager".

Cargo does it's own dependency management, so I assume you mean to say that because of this, it makes it difficult to integrate into standard methods package managers use. After reading some of the email threads with OpenBSD, I do get the sense that it's complex in that situation, but isn't that because of Ports? And Ports' expectations? Most things in Ports are C, right? I haven't worked with Ports in a long time, so I don't know it very well.

If you're pre-building something and pushing a package for say dpkg or rpm, I don't see a problem. If you're packaging source, then you'll need have the rust tools installed on the host to do that, which seems obvious.

After that, I can see some debate about blessing versions of crates in the Rust ecosystem for use in the OS' package manager, but this starts to blur the lines between what the OS is guaranteeing and what is the responsibility of the build tool. Should an OS want to bless crates, cargo does have an override for crates.io: http://doc.crates.io/config.html see the 'registry' section. I believe the other options in that configuration would also be things that the package manager on the OS would want to specify as well.

I haven't done any of this myself, but would be interested in trying to help figure it out if you have specific concerns.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:14AM (#14347714)
My main pet peeve with cargo is lack of support for binary crates.

Compiling the whole world, including dependencies is big waste of time.

I already tried to play around with workspaces to see if at least crates only get compiled once.

With other AOT compiled languages I use, zero third party dependencies are compiled from scratch.

Re:Two years of Rust by bluejekyll on Tuesday May 16, 2017 @02:23AM (#14347748)
Yeah, I agree with this. This confused me when I first started using the language. I do think there could be some better options for caching or downloading precompiled packages, but I also think this has partly helped with the development effort in Rust as well. That being said, a system wide cached package repo could work, but it also has issues (looking at you Maven) so it would be interesting to figure out how to get it "right" when dealing with source packages.

This old issue discusses a bunch of this: https://github.com/rust-lang/cargo/issues/610 I couldn't find another in a brief search.

Edit: I should add that it does harken back a bit to my Gentoo days, where recompiling the world for that 10-15% architecture boost was a lot of fun, but also a waste of time in general ;)

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @02:34AM (#14347785)
> Cargo does it's own dependency management

Exactly, that's why it's a "fuck the package manager" approach, it ignores the package manager.

> If you're pre-building something and pushing a package for say dpkg or rpm

The problem is multi copies of the same dependencies everywhere adding all sorts of bloat and security issues. Not to mention introducing it's own incompatibilities.

> Should an OS want to bless crates, cargo does have an override for crates.io

That's a recipe for dll hell if I've ever heard one.

Re:Two years of Rust by bluejekyll on Tuesday May 16, 2017 @02:58AM (#14347856)
> The problem is multi copies of the same dependencies everywhere

most binaries would be statically linked and compiled, so there wouldn't be copies, but you do have a valid point of an issue with needing to upgrade an tool that was build with a static dependency that has an issue.

If I understand you, you're saying Rust, a general purpose language, with it's own build tool should do what exactly? I see that you believe it's doing it wrong, but every package manager for every OS out there does things differently, Rust can not fix this.

> That's a recipe for dll hell if I've ever heard one.

The package managers can be configured to work with Rust, and likewise Cargo can be configured to work with the various package managers, but it takes work.

I think what you want is every crate on crates.io to be packaged as an installable rlib and dylib for every package manager out there, with the cargo manifest used to generate the various package managers dependency graphs as necessary. This would probably look a lot like, or actually be an integration with, FPM.

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @03:47AM (#14348018)
> but every package manager for every OS out there does things differently, Rust can not fix this.

Exactly, it can't fix it but it tries to cover over this fact by bundling dependencies with every app.

> I think what you want is every crate on crates.io to be packaged as an installable rlib and dylib for every package manager out there

Basically, but more to the point, when a bug or security issue is fixed I don't want to rely on individual programs updating their dependencies. Let's say 10 years from now the rust version of gstreamer is widely used and a security issue is discovered, I want to be able to "apt-get upgrade" and know that it's patched. This is how things work now with the c version, but this can't be done with cargo, every app using the library has to update it's dependencies and many (particularly any corporate ones) will never update. Rust might be a boon for security but cargo could undermine the effort.

Aside from that, static linking creates a tonne of bloat, memory and disk. There is a reason windows apps are often so bloated compared to their linux counterparts.

> The package managers can be configured to work with Rust, and likewise Cargo can be configured to work with the various package managers, but it takes work.

I don't think that's good enough, if rust wants to be a systems language then it has to work with the system, not be a layer on top of it like java/.net/node. It can do this technically, but culturally it's looking more like node and less like c.

Re:Two years of Rust by kbenson on Tuesday May 16, 2017 @11:24AM (#14350277)
While I understand your point, there is a difference between something installed through cargo for use in building software (in the manner rust does, where it's generally statically compiled), and something installed through the package manager for use in running the system.

If I'm installed zlib for general system use, I want a package manager. If I'm installing a Rust compression library to be compiled into the program I'm working on, I want that to be managed by my build chain (especially since the version I'm using in my build may not necessarily match what I have installed on my system to run).

As another example, if someone makes a cook general purpose library using Rust, eventually it should be packaged up and shipped in the normal distro package format by the distro if it's useful. I wouldn't expect cargo to be the normal way to distribute software. It's the Rust equivalent of the old tar -zxvf package-1.2.3.tar.gz && cd package-1.2.3 && ./configure && make && make install. You can do it, but if you have a distro package, use that first.

Re:Two years of Rust by steveklabnik on Tuesday May 16, 2017 @12:30PM (#14350873)
> I wouldn't expect cargo to be the normal way to distribute software

To be clear, neither does the Rust team. You're exactly on point here.

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @06:49PM (#14354020)
> Next, I'll introduce you to a tool called Cargo, which will help you write real-world Rust programs.

From the getting started chapter of the rust book (which I believe you wrote?). That implies that rust can't be used without cargo right there. And I'm not seeing any libraries published as ubuntu packages.

After this conversation I thought I should expriment more with rust and it's linking options and quickly ran into an error of some sort (quite possibly a system one) trying to buils hello world with dynamic linking:

http://stackoverflow.com/questions/44012802/rustc-and-prefer...

Re:Two years of Rust by steveklabnik on Tuesday May 16, 2017 @07:06PM (#14354133)
(I did write the book, yes :) )

> That implies that rust can't be used without cargo right there.

rustc can absolutely be used without cargo, and is in larger companies that use tools like Bazel. And we're working on making this even better, see https://github.com/rust-lang/rust-roadmap/issues/12 for one of the major items of work this year.

Second, again, Cargo is a tool you use to build your software, not necessarily one you use to distribute your software. It's like the difference between Make and pbuild or a similar tool; see the parent comment about "./configure && make" vs a system package.

> And I'm not seeing any libraries published as ubuntu packages.

Debian has an entire tool, https://crates.io/crates/debcargo, which automatically re-packages a Cargo package into a .deb. Currently, they only package the Rust compiler itself and Cargo, but this work was done specifically so that programs in Rust could be included in the distro, but packaged the way distros like. They've mostly been working on that stuff; I assume by the time Buster's cut-off date happens, there'll be some stuff; I'd like to see ripgrep, personally.

I haven't used -C prefer-dynamic in a while; usually SO questions get answered relatively quickly though.

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @08:17PM (#14354534)
> Second, again, Cargo is a tool you use to build your software, not necessarily one you use to distribute your software.

The trouble is it's both. It's a build tool like make and I have no issue with that, I'll stick to make personally but to each there own. But I can't do that because It's also the primary distribution mechanism for rust libraries and even some apps. SPeaking of ripgrep, take a look at the installation section of ripgrep (http://blog.burntsushi.net/ripgrep/#installation) "cargo install ripgrep" is an installation option.

And because static compilation is also a distribution mechanism (just not for the end user) the binaries are 10 times larger than grep, not to mention a giant GPL trap for commercial users.

Re:Two years of Rust by burntsushi on Tuesday May 16, 2017 @09:04PM (#14354784)
> SPeaking of ripgrep, take a look at the installation section of ripgrep (http://blog.burntsushi.net/ripgrep/#installation) "cargo install ripgrep" is an installation option.

Please don't misrepresent my writing. `cargo install` is NOT the primary distribution mechanism for ripgrep. The installation section starts with instructions that use standard system package managers, and only then suggests installing it using cargo if you're a Rust programmer. Why did you leave that out?

You might also consider looking at the actual README of the project[1], which lists several more installation options, including using brew, chocolatey, pacman, emerge, dnf, yum and nix. There is clearly an effort to suggest that users install ripgrep using their standard system package manager.

Some of the points you've made in this thread are valid concerns, but please don't misrepresent other peoples' hard work while you're doing it. It's extremely rude.

[1] - https://github.com/BurntSushi/ripgrep#installation

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @09:29PM (#14354881)
Sorry, I didn't mean to imply that cargo was the primary distribution method, merely that it was one and that cargo has gone well beyond being a build tool. Rereading the comment I can see how you interpreted it that way. I could have been any app built, ripgrep was just the only one that came to mind.
Re:Two years of Rust by steveklabnik on Tuesday May 16, 2017 @09:21PM (#14354856)
We have resisted adding features to Cargo that would make it better for end-user distribution, and the RFC for "cargo install" made it explicit that it's a non-goal. It's for distributing stuff for Rust developers, like additional Cargo commands, not for general end-users.
Re:Two years of Rust by flukus on Tuesday May 16, 2017 @09:36PM (#14354909)
What's the policy of crates then? It's clearly being used here as a way of distributing end-user software. If node is anything to go by then this will only increase.
Re:Two years of Rust by jfoutz on Tuesday May 16, 2017 @01:56AM (#14347660)
But that's how languages do it. CPAN was my first experience with it. At development time, I need weird libraries.i hope they're ready by release time. Package managers are awesome, but sometimes, fuck them.
Re:Two years of Rust by flukus on Tuesday May 16, 2017 @02:07AM (#14347687)
Higher level languages get away with it because they are platforms in their own right, rust is meant to be a systems level language. I expect a systems level language to work with the system, not against it.
Re:Two years of Rust by jfoutz on Tuesday May 16, 2017 @02:36AM (#14347788)
I think I understand your opinion, but I'm asserting development time is wierd. Sometimes I need the bleeding edge. Sometimes I'm debugging the bleeding edge. If you're willing to stuff nightlys in artifactory, I'm willing to roll with the package manager. Realistically People aren't willing to own that process, so I grab a sane ish version, and go on with my life.
Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:16AM (#14347721)
So do you enjoy packaging code for every single OS, in its own specific way?
Re:Two years of Rust by flukus on Tuesday May 16, 2017 @02:23AM (#14347749)
Of course I don't, but I don't think it's an important aspect in any case.

I think the user experience is more important than the developer experience. Using shared libraries that are likely already in memory provides a better user experience because it's faster, more stable, more secure and uses less memory.

The cargo approach will end up with windows/node level bloat where every app bundles half an OS.

Re:Two years of Rust by AsyncAwait on Tuesday May 16, 2017 @09:20AM (#14349303)
True, but there's not a simple, unified way to maintain packages across all major platforms that does not involve having your own package manager like Cargo.
Re:Two years of Rust by flukus on Tuesday May 16, 2017 @06:51PM (#14354025)
No there isn't. That doesn't mean a rust platform has to be created that sits on top of the system.
Re:Two years of Rust by kbenson on Tuesday May 16, 2017 @07:36PM (#14354339)
Well, there is benefit to the platform, I think you've just misinterpreted it's use.

Cargo is to Rust as cpan (the client) is to Perl, as pip is to Python, and as gem is to Ruby. All those other languages also have packages provided in many distros, but the developtment tool listed that downloads and installs relevant packages is also used when appropriate. For the regular, non-developer user that needs a module to support some program, that may be never. For the developer working in those languages that needs the newest version of the package, regardless of the back-patching policy of their distro, that may be often.

Re:Two years of Rust by flukus on Tuesday May 16, 2017 @09:32PM (#14354898)
> Cargo is to Rust as cpan (the client) is to Perl, as pip is to Python, and as gem is to Ruby.

As I said, rust is meant to be a systems language, it shouldn't have an equivalent of cpan and, pip or gem because it needs to work with the system, not be yet another platform.

Re:Two years of Rust by kbenson on Tuesday May 16, 2017 @10:34PM (#14355180)
> rust is meant to be a systems language

It's meant to useful as a systems language, so was designed with certain constraints in mind. It is whatever people want to make of it. There have been plenty of instances I've seen on HN alone of people mentioning use that isn't specifically tailored for a systems language.

> it shouldn't have an equivalent of cpan and, pip or gem because it needs to work with the system, not be yet another platform.

Those are entirely orthogonal issues. Cargo works with the system just as well as tar and make. They're just binaries. You could just as easily say that traditional source tarballs shouldn't be provided because people might download the source and use their compiler to build instead of using the distro package. This is a non-issue. The only people that will even have the choice are those that chose to install the compiler (whether it be a C compiler or Rust), and even then the vast majority that actually do so will probably end up having a good reason for doing so.

Cargo is part of the build tool chain. Just because it can be used to distribute a package, and even while it probably will be used to distribute a package, that doesn't mean it's purpose is to do so, or that it's inappropriate that it exists. Any feature can be abused. You should not judge it by the abuse, but by its intended and common use.

Re:Two years of Rust by vvanders on Monday May 15, 2017 @06:38PM (#14345790)
Mostly gut feeling :).

To be fair my javac comparison with with Gradle + Android Studio layered on top so it may be a bit slanted in favor of Cargo/Rust. That said I've never seen a Java build environment that I'd call 'snappy'.

Re:Two years of Rust by fnord123 on Monday May 15, 2017 @07:05PM (#14345995)
Maven takes a long long time to start up, but once it's ready, javac is pretty quick.

Some Rust projects are very quick to build; but some are astonishingly slow to build. e.g. lalrpop is unusably slow (~15mins to build on 2014 Macbook Air).

I think the place here performance breaks down is liberal use of generic types in functions. e.g. AsPath<T> and AsRef<T>, etc.) where the compiler creates the function for all the different types and then tries to collapse them again later on. So one rules of thumb is to only use those in the public APIs and convert the type so it can be passed around without generics internally within a module. Or maybe that's just me trying to do some `cargo cult` heuristics (haha! puns!)

Re:Two years of Rust by wtetzner on Monday May 15, 2017 @07:21PM (#14346082)
> Or maybe that's just me trying to do some `cargo cult` heuristics (haha! puns!)

I always thought `cargo new` should have been called `cargo cult`.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:22AM (#14347739)
So better try again with straight javac, Ant and Maven.

Gradle sucks big time, why do you think Google still does talks letting angry Android developers that Gradle + Android Studio will some day be as fast as Ant + Eclipse?

http://androidbackstage.blogspot.de/2017/04/episode-64-gradl...

https://www.youtube.com/watch?v=BKRK4SvMtRk

The Android Gradle plugin being slow as molasses is a typical discussion theme at Google IO since it was introduced. Being partially written in Groovy also doesn't help.

Re:Two years of Rust by lenkite on Wednesday May 17, 2017 @11:50AM (#14359635)
Take a look at the Kobalt build system http://beust.com/kobalt/home/index.html
Re:Two years of Rust by steveklabnik on Monday May 15, 2017 @05:37PM (#14345341)
"rustc is too slow" is possibly our most commonly-heard feedback. I am glad that you don't find it onerous, but many still do.
Re:Two years of Rust by bluejekyll on Monday May 15, 2017 @07:34PM (#14346152)
I don't know... I really think it depends on the audience you're catering to. As someone who only ever deals with compiled languages, this has never seemed to be a problem.

Now, viewing this as someone coming from Python, Ruby, Node, etc., I can see compilation as being annoying. Is it really the only reason that they are disliking the language or is that just a strawman?

I wonder if too much attention is being paid to this. Now there are legitimate things we can focus on, such as making cached precompiled libraries very easy to use. This can especially be important in CI environments... This would also generally make most compilations fast.

Re:Two years of Rust by steveklabnik on Monday May 15, 2017 @07:48PM (#14346232)
> such as making cached precompiled libraries very easy to use.

This is already true today; that is, this cost is only paid the first time you compile. It's still not fast enough for people.

On my machine, a fresh build of rustc takes an hour, and small changes take 20 minutes, and even that makes it a giant pain. It's an ergonomic thing, IMO.

Re:Two years of Rust by bluejekyll on Monday May 15, 2017 @08:32PM (#14346475)
I should have been more clear; I mean a solution for many devs to pull precompiled caches, and share those for the same version of libraries... this would also benefit CI, as all CI runs to be based off this.
Re:Two years of Rust by kibwen on Monday May 15, 2017 @07:55PM (#14346262)
> a fresh build of rustc takes an hour

A bit influenced by the fact that rustc has to compile itself three times. :P

Re:Two years of Rust by steveklabnik on Monday May 15, 2017 @08:26PM (#14346437)
Sure, but as with all end-user stuff, I don't care what it has to do, just that it has to do it.
Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:25AM (#14347756)
Turbo Pascal 5.5 was compiling 34,000 lines/minute.

https://edn.embarcadero.com/article/20803

And even today Delphi 10 is quite fast.

Same applies to many other compiled languages with modules.

Re:Two years of Rust by bluejekyll on Tuesday May 16, 2017 @03:16AM (#14347909)
I haven't worked with Pascal since 1999, I remember it being a much simpler language.

And no where near as fun. Hilarity ensued when I didn't realize there was no garbage collector.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @03:32AM (#14347968)
Pascal and Turbo Pascal aren't the same thing.

Turbo Pascal was more a kind of simplified Ada than a pure Pascal, which made me look down on C when checking down the laundry list of language features of Turbo Pascal 6.0 versus ANSI C89 in 1993.

Also by 1999 no one was doing anything serious in Turbo Pascal with the last version being targeted at Windows 3.1.

Delphi 1.0 was released for Windows 95, and it did at least have some kind of GC for COM based classes.

Also Delphi 10 might not have every Rust feature, but it surely has it own set of complex language features.

Or if you prefer Ada, C#, D are also possible sources of information regarding performance of compilation toolchains, with relatively complex languages.

Re:Two years of Rust by WatchDog on Monday May 15, 2017 @05:52PM (#14345464)
Is it as fast as javac? Maybe on a line of code basis, but I imagine java is much simpler to to implement incremental compilation with. Since sources map pretty much 1 to 1 with classes, you mostly only need to recompile the class that changed.
Re:Two years of Rust by swsieber on Monday May 15, 2017 @10:19PM (#14346912)
Unfortunately, it's not quite that easy since java inlines constants, plus you have to account for package protected, inherited methods, etc. that you don't have to implicitly import. But really, it's the constants that make incremental compilation slower...
Re:Two years of Rust by amorphid on Monday May 15, 2017 @10:21PM (#14346923)
When you compile Java from the command line, is the compiler smart enough to not recompile files that haven't changed? Or is that an IDE feature?
Re:Two years of Rust by cytzol on Tuesday May 16, 2017 @05:26AM (#14348365)
javac itself doesn't do any incremental compilation and will happily compile over your .class each time (though you can tell it not to; see http://stackoverflow.com/q/8271282)

Build tools like Maven and Gradle, as well as IDEs' internal build tools, will be smart and compile only the changed files.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:10AM (#14347697)
I wish it would be on par with javac, but my experience compiling rustfmt, rustsym and racer tells me otherwise.

Also a bit disappointed when compared with other languages that support modules, specially the ones whose toolchains support binary dependencies.

Not everyone has a high end development workstation.

I am however confident the experience will eventually improve.

Re:Two years of Rust by kibwen on Monday May 15, 2017 @07:50PM (#14346240)
> but usually it does far worse

Cite a source? This isn't my experience at all, Rust is still way faster at compilation than C++ on average. The advantage that C++ currently has is ccache which helps avoid needless rebuilds (which pairs well with C++'s smaller compilation units relative to Rust); building this behavior into the compiler is part of what the incremental compilation initiative is addressing.

Re:Two years of Rust by lumpypua on Monday May 15, 2017 @08:02PM (#14346300)
https://michaelfairley.com/blog/i-made-a-game-in-rust/

> It consists of ~7700 lines of Rust

...

> Compile times with Rust are Not Great. This is easily my single biggest gripe about Rust right now. The build for A Snake’s Tale takes 15+ seconds, which makes iterating rather tedious. The current incremental compiler work also doesn’t seem to make the build for A Snake’s Tale’s codebase any faster.

Re:Two years of Rust by kibwen on Monday May 15, 2017 @08:45PM (#14346527)
That compile time is Not Great, but 15 seconds for 7700 lines of code isn't even close to "far worse than C++". :P If incremental compilation is showing no benefits whatsoever, then I'm guessing that time is largely attributable to linking (and I tend to doubt that 7700 lines of code is counting the basic third-party libraries that are required to create a crossplatform GUI app (but I'd love to be surprised!), which will contribute to linkage time... LLD please!).
Re:Two years of Rust by stevedonovan on Tuesday May 16, 2017 @02:44AM (#14347814)
For a full rebuild, that's a reasonable C++ build time for a project of this size. But full rebuilds are not representative, if the project is composed of many independent compilation units. The compilation unit in Rust is the crate, which is an exe or a library, so currently the best strategy is lots of little crates, which is not so ergonomic (heh) with Cargo.

Actually, the compiler isn't the bottleneck - most of the time is LLVM codegen. So 'cargo check' is fast - the miri MIR interpreter likewise.