9 ms·
Rust 1.34.0
- trzeci 8y agoSuch a boring release. That's why I love Rust.
- Twisol 8y agoFor the most part, that's true. But I am so excited that custom Cargo registries have finally landed!
- pjmlp 8y agoFor me the best releases will be when it matches D/Delphi/Ada/Eiffel/.NET Native compile times and cargo supports binary dependencies. The language as such is already quite good, in spite of one or other possible improvements on borrow checker ergonomics (e.g. callbacks).
- steveklabnik 8y agoBinary deps are on the Cargo team’s plans for the year, and compile times are always a focus. Working on it!
- pjmlp 8y agoLooking forward to them. :)
- whatshisface 8y agoWe will soon have async/await syntax which will replace some of the use case of callbacks, and (I assume) reduce the borrow bookkeeping tedium.
- pjmlp 8y agoI don't think it covers GUI callbacks like on Gtk-rs, accessing internal widget data.
- bbatha 8y agoI think that's likely. async/await doesn't appear to map directly onto traditional OO GUI framework callbacks well, just like rust doesn't tend to map well to traditional OO. I believe that async/await will open up new architectural patterns that should be as ergonomic as traditional OO callbacks for GUIs. But these won't map well to existing code or existing frameworks.
- steveklabnik 8y agoThere have been attempts, like relm, to map futures onto GTK. That means it would work with async/await too, as they’re fundamentally sugar for futures.
- bbatha 8y agoEven those are basically Relm components that happen to render via GTK. You can't really import a plain `GObject` and implement a traditional `fn on_click()` without having to worry about internal mutability and the associated borrow checking complexities.
- servilio 8y agoWhy binary dependencies, what for?
- pjmlp 8y agoCompile speed, not compiling the same dependencies all over the time. Many commercial use cases require distribution of binary libraries, Rust community might care about winning those customers, or just let them go and leave them to keep using the languages that fulfil such use cases.
- MaulingMonkey 8y agoAnd if you have to drop down to looking at the disassembly, distributing binaries helps ensure everyone's looking at the same disassembly. Reasons for this include investigating codegen bugs, figuring out optimization issues, ensuring functions involved in cryptography aren't leaking information through timing side channels, etc...
- servilio 8y ago> Compile speed, not compiling the same dependencies all over the time. Sounds like caching these would be a simpler but solution. > Many commercial use cases require distribution of binary libraries [...] Good use case, and in this case another cache would solve the issue as well. Defining a protocol for binary caches and being able to add your own could solve this very well. The same solution could help solve the previous one too. BTW, if you are in either case, have you looked into Nipxkgs[1]? They might be able to do both, the basic capabilities are there, not sure if the Rust infrastructure[2] already provides it. [1] https://nixos.org/nixpkgs https://nixos.org/nixpkgs [2] https://nixos.org/nixpkgs/manual/#users-guide-to-the-rust-infrastructure https://nixos.org/nixpkgs/manual/#users-guide-to-the-rust-in...
- eikenberry 8y ago> For me the best releases will be when it matches D/Delphi/Ada/Eiffel/.NET Native compile times [..] Any ideas on when this will be? There has been talk about faster compile times for years now without that much apparent progress.
- steveklabnik 8y agoWe can only speculate about the lower bounds of compile times, but making things faster takes a lot of work. Rustc is a huge codebase, and making general leaps requires large architectural changes. We’ll just keep chipping away. It’ll take some time. There has been a lot of progress, it’s just been slow and steady. For example, since the first of 2018: https://perf.rust-lang.org/compare.html?start=2018-01-01&end=&stat=wall-time https://perf.rust-lang.org/compare.html?start=2018-01-01&end...
- burntsushi 8y ago> There has been talk about faster compile times for years now without that much apparent progress. Really? What makes you say that? Have you tried it? $ git clone git://github.com/BurntSushi/ripgrep $ cd ripgrep $ git checkout 0.4.0 $ time cargo +1.12.0 build --release real 1:09.13 user 2:06.08 sys 2.839 maxmem 359 MB faults 1292 $ cargo clean $ time cargo +1.34.0 build --release real 22.484 user 2:32.66 sys 3.380 maxmem 702 MB faults 0 That's a >3x wall-clock speedup over the past 2.5 years on a cold start. That's pretty good.
- Datenstrom 8y agoPersonally I am very excited about TryFrom, I have been waiting for that forever it seems.
- lewisinc 8y agoAgreed! I definitely have a handful of hand-rolled `try_from` definitions that I'm excited to erase from existence.
- fxfan 8y agoIt feels like Rust is now 'stable'. Are there any major language related things in the pipeline?
- vvillena 8y agoAsync/await is probably the next "big" feature.
- steveklabnik 8y agoThe biggest one in the near future is async/await; you’ll see the precursors land in the next few releases. There will also be a blog post soon outplaying overall plans for the year, but const generics, GATs, and specialization are the likely big-ticket items. In general, this year of Rust will be about governance refactoring, finishing off long-desired features like the ones above, and general polish. There isn’t a lot of big plans for big new things coming anytime soon, more of finishing what we’ve started and improving what we have.
- yash1th 8y agoI liked the concept of alternate registries in this release
- pohl 8y agoI imagine this will unshackle some people who have been wanting to use Rust within organizations.
- steveklabnik 8y agoThat is one of the main motivating factors!
- jithesh 8y agoNow that alternate registries to crates.io is available, hoping artifactory could add support for rust... - https://www.jfrog.com/jira/browse/RTFACT-13469 https://www.jfrog.com/jira/browse/RTFACT-13469
- pythonist 8y agoand https://newreleases.io https://newreleases.io to support at least https://crates.io.. https://crates.io...
- epage 8y agoLooks like thats a site for notifying you of new dependencies? I think I'd prefer PRs like https://dependabot.com/ https://dependabot.com/
- Manishearth 8y agoNote that Rust has supported mirroring ("source replacement") for a while now. https://doc.rust-lang.org/nightly/cargo/reference/source-replacement.html https://doc.rust-lang.org/nightly/cargo/reference/source-rep... This feature is for alternate registries that _supplement_ crates.io
- indentit 8y agoIt will be nice when Cargo dependencies can use pre-built binaries instead of having to compile the whole dep chain. One crate I contribute to has a 4 GiB target folder and takes 20 mins to compile from scratch...
- steveklabnik 8y agoSee below, that is planned. Can’t guarantee a timeframe though.
- saghm 8y agoIn the meantime, you can use sccache to at least save the time spent to compile the same version of a crate more than once. https://github.com/mozilla/sccache https://github.com/mozilla/sccache
- indentit 8y agothanks for the recommendation. if I understand [1] correctly, this cache is hosed when you upgrade rust? [1]: https://github.com/rust-lang/cargo/issues/1139#issuecomment-69350600 https://github.com/rust-lang/cargo/issues/1139#issuecomment-...
- the_duke 8y agoYes, everything needs to be rebuilt with the new compiler after a ugprade, but sccache still provides very valuable time savings when you work on multiple Rust projects.
- agumonkey 8y agoreminds me of nixos early days, then they added binary channels, so much nicer
- adamnemecek 8y agoRust is legit next gen, check it out today.
- korethr 8y agoHmm, fn before_exec strikes me as a thing that should be gotten rid of entirely in favor of unsafe fn before_exec if the former indeed turned out to actually have the potential to cause undefined behavior. But that'd probably be a breaking change which would require a major version number bump, so deprecation is absolutely the right thing IMO. And it also sets the stage to get rid of it outright come the next major version bump. This is the first such instance of "oops, turns out that wasn't safe after all, that should have been unsafe" that I've heard of in Rust. Is that because this is the first such mistake since the 1.0 milestone (the rest of `unsafe` having been nailed down before 1.0), or have there been other such mistakes that I didn't hear about because I haven't read the notes for all of the prior releases of Rust?
- GolDDranks 8y agoI wonder if they could after some time make it a "harder" deprecation; fail by default, and enabled only with an `#[allow]` annotation.
- tspiteri 8y agoThat would still break existing code: you have to change it for it to compile. And if you are going to change the code, it makes more sense to change the code to use pre_exec in an unsafe block than to use before_exec with an #[allow] annotation.
- pdpi 8y agoNot sure if there was nothing post-1.0, but this[0] particular mess was just before the 1.0 release and, at the time, caused a fair bit of chaos. 0. http://cglab.ca/~abeinges/blah/everyone-poops/ http://cglab.ca/~abeinges/blah/everyone-poops/
- eridius 8y agoI remember that one. It came in just under the deadline and it would have been pretty bad if that got into 1.0. The resolution of this not only had a notable effect on how Rust thought about memory safety (in particular, that leaking memory could not be considered unsafe as it's always possible to construct a leak using safe Rust if you have access to Rc, and as a result `std::mem::forget()` was changed from unsafe to safe), but also informed the way we used RAII going forward, as the fundamental unsafety was due to the use of an RAII value as a token representing external computation and was not itself used in order to perform that computation, which meant leaking the token didn't prevent computation from happening. In all other known cases of RAII, leaking the value is safe because without the value, you can't access the protected resources, but in this case the token represented a thread and the thread of course would continue to run after you leak the token. As a takeaway from this lesson, you can't use tokens to represent external processes, and probably shouldn't use them to represent e.g. hardware that needs to be put back into a known state when the token is dropped unless you have a mutex in there as well (which would cause deadlock if you drop the token and then reuse the resource, rather than sending bad commands that break the hardware). Instead, any time leaking the token would cause unsafety, you need to structure your code to use explicit scopes instead, such that the library can clean up at the end of the scope.
- deleted 8y ago[deleted]
- FullyFunctional 8y agoNo mention of RISC-V support? It sounds like RV64GC finally landed (Hurra and thanks!): "riscv64imac-unknown-none-elf and riscv64gc-unknown-none-elf targets are now on stable rustc 1.34.0 :slightly_smiling_face: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1340-2019-04-11" https://github.com/rust-lang/rust/blob/master/RELEASES.md#ve... https://github.com/rust-embedded/wg/issues/218#issuecomment-482307010 https://github.com/rust-embedded/wg/issues/218#issuecomment-... EDIT: Mea culpa, I somehow missed that it _is_ in the release notes, but still, it's worth pointing out. I hope it'll find its way into Fedora/RISC-V.
- Perceptes 8y agoThe history of TryFrom/TryInto has spanned 3 years, from when it was originally proposed as an RFC in 2016. For a seemingly simple API, it's gone through a lot. Especially unusual was that it was stabilized a few releases ago and then had to be destabilized when a last-minute issue was discovered with the never type (`!`). The never type had been the primary blocker for stabilizing these APIs for the last year or so, but it was finally decided to simply use this temporary `Infallible` type, which would be mostly forwards compatible with the never type itself. I've followed the issue closely because it's one of the features used in Ruma, my Matrix homeserver and libraries. In fact, for the library components of the project, it was the last unstable feature. With the stabilization of these APIs, I'll finally be able to release versions of the libraries that work on stable Rust. This will happen later today!
- swsieber 8y agoHere's a funny quote about that... >> Can you eli5 why TryFrom and TryInto matters, and why it’s been stuck for so long ? (the RFC seems to be 3 years old) > If you stabilise Try{From,Into}, you also want implementations of the types in std. So you want things like impl TryFrom for u16. But that requires an error type, and that was (I believe) the problem. > u8 to u16 cannot fail, so you want the error type to be !. Except using ! as a type isn’t stable yet. So use a placeholder enum! But that means that once ! is stabilised, we’ve got this Infallible type kicking around that is redundant. So change it? But that would be breaking. So make the two isomorphic? Woah, woah, hold on there, this is starting to get crazy… > new person bursts into the room “Hey, should ! automatically implement all traits, or not?” > “Yes!” “No!” “Yes, and so should all variant-less enums!” > Everyone in the room is shouting, and the curtains spontaneously catching fire. In the corner, the person who proposed Try{From,Into} sits, sobbing. It was supposed to all be so simple… but this damn ! thing is just ruining everything. > … That’s not what happened, but it’s more entertaining than just saying “many people were unsure exactly what to do about the ! situation, which turned out to be more complicated than expected”. https://this-week-in-rust.org/blog/2019/03/05/this-week-in-rust-276/ https://this-week-in-rust.org/blog/2019/03/05/this-week-in-r... https://www.reddit.com/r/rust/comments/avbkts/this_week_in_rust_275/ehe2kre/?context=1 https://www.reddit.com/r/rust/comments/avbkts/this_week_in_r...
- ben0x539 8y ago> People maintaining proprietary/closed-source code cannot use crates.io, and instead are forced to use git or path dependencies. This is usually fine for small projects, but if you have a lot of closed-source crates within a large organization, you lose the benefit of the versioning support that crates.io has. I'm surprised that making people run their own registries is the preferred way to address this, instead of implementing versioning support for git dependencies. There's many bad things I say about golang, but "I wish this module system additionally required me to host a language-specific package repository" is not one of them.
- Waterluvian 8y agoI dunno. The worst part of Go in my opinion is that disaster that is packaging. I like rust because there isn't eleventy ways to do things like that. I can certainly see your perspective. I'm just of the other opinion.
- zengid 8y agoI don't think it's unheard of though: my employer has their own Nuget package server for internal packages.
- MaulingMonkey 8y agoIt can be useful to run your own package server even if you're not creating your own packages. You can use this to keep a curated list of packages that your team finds commonly useful / has audited / has had the license blessed by legal / ???, or to be productive during an internet outage, slowdown, or lockdown, etc.
- iopq 8y agoIf there is no Internet, I'm going home. You can't seriously expect me to work without StackOverflow
- MaulingMonkey 8y ago