Live data from Hacker News

Two years of Rust

blog.rust-lang.org

251–260 of 312 posts

Re: Two years of Rust

#251
post #56

Earlier quoted context omitted.

> about how futures-based concurrency spreads into your code through huge amounts of necessary boilerplate (`.and_then(...).and_then(...).and_then(...)`) How is that more boilerplate than any other way to have concurrency?

Async/await is commonly suggested as a lighter-weight syntax.

Well, isn't async/await complementary to futures?

Re: Two years of Rust

#252

Earlier quoted context omitted.

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…

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'.

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

#253
post #248

Earlier quoted context omitted.

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…

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.

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

#254
post #249
post #244

Earlier quoted context omitted.

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.

So do you enjoy packaging code for every single OS, in its own specific way?

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

#255

Earlier quoted context omitted.

"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.

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…

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

#256
post #233

Earlier quoted context omitted.

That assumes you're using cargo and it's "fuck the package manager" approach.

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…

> 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

#257
post #244
post #240

Earlier quoted context omitted.

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.

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.

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

#258
post #241

Earlier quoted context omitted.

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.

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…

Well, as you said, C++ had a ton more effort poured into the toolchain, at this stage.

Re: Two years of Rust

#259
post #168

Earlier quoted context omitted.

> 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.

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.

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.

Re: Two years of Rust

#260
post #43

Earlier quoted context omitted.

Yeah, I certainly understand various language trade-offs, but in my experience any of these early wins of interpreted languages come back to haunt you at significant cost. If you understood the wins of untyped languages, you'd be aware that this is often the most optimal path for a startup to take. Get features done now + fix them later is, in hundreds of cases, the way that startups win. It's also a win for people w…

If your language doesn't have a REPL, your language is less productive. Deal with it. Oh hardly. As someone who's developed software in Perl, Python, C, Java, C#, Haskell, and a few others besides, a REPL is the one thing I use the least . I've honestly never understood the obsession with it. Is a rapid compile-run-debug cycle important? Absolutely. If I want to test something in isolation, being able to rapidly turn…

I love using a REPL, but I kind of agree with you.

I happen to use more often the IDE's graphical debugger than the REPL.

Still Visual Studio has had immediate mode (aka REPL) since VB days, followed by .NET support.

Post reply on HN