10 ms·
Rust 1.49.0
- darksaints 6y agoCurious why the distinction between tier 1 and tier 2 targets is testing. Is testing that burdensome? Why can't the tests be run on them?
- koenigdavidmj 6y agoTier2 compiler can be built with a cross-compiler, perhaps, but you don’t have consistent access to hardware to run the tests on. Just a guess
- steveklabnik 6y agoThe difference is not "testing" in a broad sense, the difference is "tests guaranteed to pass" vs "tests may run if they exist but we don't gate on them passing." Being able to guarantee that they pass means having the expertise to fix any issues, and with a timeliness to be able to fix them and not block a release. That requires people around to support the target, with a higher burden than tier 2. (Technically, it's even more than "not block a release" it's "not block any PR that may start failing on that target," since all tests must pass before a PR is landed.)
- Diggsey 6y agoCommits don't reach master until they have passed all the test suites. As such, it is very burdensome to add more test suites: it increases the time taken to run the test suite and reduces the throughput of all rust development. Not to mention, many of the tier 2 or lower targets are not easy to run in CI. You could ask: why aren't the tier 2 tests just run before release? But then, if they are broken it may be a significant amount of work to fix, and could delay the release. Maybe there is a middle-ground where tier 2 tests are run daily, but then you need a team of people just to fix those tests, because it will no longer be on the original PR author to make sure those tests pass before their PR is merged.
- afavour 6y agoI think it’s that the tests aren’t run, and consequently, they don’t guarantee the tests pass, which means it might not behave exactly the same as a tier 1 platform. So the difference is bigger than just tests.
- nikic 6y agoAn important factor here is hardware access. Tier 2 targets just produce cross-compilation artifacts, tier 1 targets require actual hardware to run on. For example, a tier 1 macos aarch64 target is impossible until the hardware can be run in CI, for every merge.
- kzrdude 6y agoCI is expensive, even more on those targets.
- nitsky 6y agoI am surprised the blog post doesn't mention the stabilization of binding both by-move and by-ref in patterns [1]. I have personally been waiting on this one for several years. Time to go remove my workarounds. Thanks! [1]: https://github.com/rust-lang/rust/pull/76119 https://github.com/rust-lang/rust/pull/76119
- steveklabnik 6y agoThere is always an art to what to decide to put in vs not, and it wasn't 100% clear to us how important folks consider this feature. We waffled a bit, it was basically a coinflip on putting it in or not.
- the_mitsuhiko 6y agoI generally started going from the blog posts to the changelog as I felt for a few times now that the stuff I care about was not in the announcement blog post.
- steveklabnik 6y agoYeah, it's just impossible to please everyone, especially in releases like these, which have a few minor things and that's it. Rust 1.51 will be easy, given that "const generics" is a huge headline feature almost every Rust user will care about, but for features that are full of tiny things, it's just way way less clear. This has the funny effect of posts getting harder to write as time goes on; we have less releases with big, important features, and more releases with "tons of bugfixes and some minor improvements."
- lumost 6y agoIt might be worth separating the different improvement areas by section to let people zoom in on what they care about.
- steveklabnik 6y ago
- option_greek 6y agoI wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is still better than C++ - namely its package management is great. I just wish the compiler doesn't keep second guessing me :D
- ChrisSD 6y agoI'm not sure what you mean by conversion between String and &str? To get an owned String from a &str you just use the `into` method, no?
- steveklabnik 6y agoStrings implement a lot of different conversions, since they're very general. You've got: * Into, with s.into() * An inherent method, .as_str() * Deref coercion, &s * Reborrowing, &*s (this builds on Deref too but isn't a coercion and can be done in places where coercion doesn't kick in) ... and probably some others I'm forgetting.
- ChrisSD 6y agoRight but as a general rule you'll mostly only be using `s.into()` to get a `String` from an `&str`. Or `&s` to deref `String` to a `&str`. I'm not sure why this would require a crate to handle? The other ways are more "advanced", for when you're dealing with (for example) potentially unsafe coercions or you don't want to rely on inference for some reason.
- steveklabnik 6y agoI agree with you that I'm not sure what your parent is talking about, I'm just here to give all the examples. Deref coercion takes 99% of my String -> &str conversions, and I reborrow for that rare 1%, personally.
- pjmlp 6y agoCongratulations to everyone. For me it was specially nice to have some minutes shaved off from full builds.
- dbrgn 6y agoRust, where even unstable functions can be stable! (Yes, I know that "unstable" in slice::select_nth_unstable refers to unstable sorting.)
- boxmonster 6y agoI recently wrote a utility for myself in Rust after having done several in C#. I like both languages, but Rust introduces pain points for no apparent reason. For example, I hate this way of dealing with errors match result { Ok(value) => value, Err(result) => { panic!("error traversing directories {}", result); } }; It's awkward and ugly. I'm back to C#, now on .NET 5.) and find that it just got noticeably faster! It was already fast. "Astonishing Performance of .NET 5: More Data" https://medium.com/swlh/astonishing-performance-of-net-5-more-data-5cdc8d821e8c https://medium.com/swlh/astonishing-performance-of-net-5-mor...
- steveklabnik 6y agoThis code is equivalent to result.unwrap_or_else(|e| panic!("error traversing directories {}", e)); There are a lot of methods on various types to reduce this kind of thing. If you didn't want to interpolate the value of e, it would be even simpler: result.expect("error traversing directories");
- shepmaster 6y ago> If you didn't want to interpolate the value of e For those reading along (not Steve) expect does do that, but using the Debug formatter instead of Display, as the grandparent used.
- boxmonster 6y agothe unwrap_or_else makes a lot more sense, because I could just use the ? operator, but if I don't want to panic, then I'll use unwrap_or_else. I am not by any means an advanced Rust programmer and in fact learning from your book, so I didn't mean to offend anyone. My initial impression of the match syntax for return values was that I didn't like it. Sorry.
- adkadskhj 6y agoMatch has it's place in unpacking common Enum types like Option and Result, but typically you'll reach for functional patterns like `Result::map`, `Result::expect`, `Result::unwrap_or`, and of course `?` as they're able to do the same thing but in far less code. I think the downvotes are because both the example and the generalized statement that C# is "noticeably faster" is bait / lazy.
- deccanchargers 6y agoNice. Rust is nice language btw. But,when will stable version of Rust be released? By stable,i mean, number of new features added must not be too much. Rust currently seem to be adding too many features every release (which is nice but also not so good at same time)
- jcelerier 6y ago> but also not so good at same time why ? do they charge you by the feature ?
- dbrgn 6y agoBy that measure, both Java and JavaScript are highly unstable programming languages.
- shadow31 6y agoDon't forget C, after all `C2x` is coming...
- steveklabnik 6y ago> By stable,i mean, number of new features added must not be too much What is "too much"? How many would you prefer? How does this release have too many features? This release has three, and they're all pretty small. Some could even argue that they may not even count as new features, but remove restrictions between combinations of existing features.
- ufo 6y agoA question for the Rust crowd, from someone who's thinking about giving Rust another chance in 2021: Last time I tried getting into Rust, some years ago, the recommended way to install it was to use the rustup tool. You were also kind of expected to learn using the "nightly" version of the language, because much of the documentation and stackoverflow answers depended on that. Is this still the case now that we're about to enter 2021? Is it OK to learn rust by installing it via "apt install", or is it still recommended to use rustup? Is it OK to stick just to stable Rust or should I expect that I will need to install the nightly version at some point?
- rapsey 6y agoStable rust is perfectly fine. The vast majority of Rust users are on stable only.
- nobleach 6y agoUnless you want to try out Rocket. That one STILL requires nightly...
- ibraheemdev 6y agoRocket 0.5 (which is coming soon) will compile on stable. Alternatively, you can the master git branch directly. Very few libraries still require nightly. Most of them have moved or are moving to stable.
- deleted 6y ago[deleted]
- steveklabnik 6y agoRegarding nightly: https://blog.rust-lang.org/2020/12/16/rust-survey-2020.html https://blog.rust-lang.org/2020/12/16/rust-survey-2020.html > the number of users who are relying on a nightly compiler at least part of the time continues to drop - down to 28% compared with last year’s 30.5% with only 8.7% of respondents saying they use nightly exclusively. When asked why people are using nightly the largest reason was to use the Rocket web framework which has announced it will work on the stable version of Rust in its next release. The next largest reason for nightly was const generics, but with a minimal version of const generics reaching stable, we should see less of a reliance on nightly for this feature. TL;DR: unless you're doing certain specific things, stable Rust should work well for you. Regarding rustup vs apt, you can absolutely install via apt if you want to. Depending on what version you get, you may or may not be far enough behind the rest of the world for it to be a pain. Which version you'll get depends on the specifics of the distro.
- Galanwe 6y agoAny chance to see increased support for 8bit AVR in upcoming releases? I know Rust is community driven, so it's not like contributions will appear from thin air. But I guess maybe it would be time to promote/incentivize people to contribute support for microcontrollers. This is a realm where C reigns and Rust would be a bowl of fresh air.
- steveklabnik 6y agoFolks are still working on it, yep. I mean, Rust does have support for many microcontrollers. I do ARM stuff for work, for example. Just not AVR. It'll be nice to have it though!
- dbrgn 6y ago32 bit microcontrollers are well-supported, and often cheaper, more power efficient and with more features than old 8-bit uCs. https://github.com/rust-embedded/wg https://github.com/rust-embedded/wg
- sitkack 6y agoThat is true but there are literally millions of AVR based Arduinos out in the world and I can confirm that they are totally usable with Rust.
- Galanwe 6y agoMaybe, but 8bit MCUs are simple, efficient, have a huge community & resources, and more importantly exist in convenient DIP & SOIC form factors.
- lights0123 6y agoRust has full support for AVR, excluding function pointers due to current LLVM bugs. Building on stable would be nice though, as it currently requires a custom target JSON file.
- Galanwe 6y ago> Rust has full support for AVR Last time I checked (6 month ago), the Rust AVR fork had just been merged upstream. This removed the necessity to build a forked rustc from a patched llvm. I would have to re-check recent updates, but at the time there were still a lot of bugs, no core libs, etc. That's not what I would call "full support".
- Dowwie 6y agoA lot of people are using Rust for advent of code 2020. It's really interesting to see the role that AOC is having with adoption and leveling up Rust knowledge.
- Measter 6y agoThere was a survey posted on the subreddit[0], which asked about which language people used. I was quite surprised to learn that Rust was the second-most used at 10% (45% used Python). [0] https://www.reddit.com/r/adventofcode/comments/kj53l1/unofficial_aoc_2020_survey_results/ https://www.reddit.com/r/adventofcode/comments/kj53l1/unoffi...
- deleted 6y ago[deleted]
- mindv0rtex 6y agoI really enjoy using Rust for personal side projects. It made me a better C++ developer. I'm excited about stabilized const generics to be able to speed up my linear algebra code. This issue though prevents me from recommending Rust for closed source development to my colleagues: https://github.com/rust-lang/rust/issues/40552 https://github.com/rust-lang/rust/issues/40552
- steveklabnik 6y agoIt is helpful to leave comments on issues like this, by the way.
- mindv0rtex 6y agoDone!
- apta_ 6y agoWhat IDE do people use for rust nowadays?
- k5z 6y agoAlways Vim
- ibraheemdev 6y agoVS Code is one of the more popular ones, although it doesn't really qualify as an IDE. IntelliJ is probably the most popular IDE for Rust development.
- deleted 6y ago[deleted]
- UtherII 6y agoThe IDE support use to be very poor but nowadays there are two really nice contenders : - Jetbrains IDE with the Rust plugin (maintained by Jetbrains itself). The free IntelliJ IDE Community works really well. CLion or IntelliJ Ultimate are necessary for debugging support - The Rust-analyser tool. A language server that can be used, in theory, on any IDE supporting the LSP protocol. Code is the most used IDE with this tool since it is the reference IDE of the project.
- candied_scarf 6y agoi am disappoint there isnt mention of more private/reproducible release binary output from compilation https://github.com/rust-lang/rust/issues/40552 https://github.com/rust-lang/rust/issues/40552 https://github.com/rust-lang/rust/issues/75263 https://github.com/rust-lang/rust/issues/75263
- steveklabnik 6y agoThis bugs are still open, so there’s no reason to talk about them in a release announcement. If they were fixed, and made it into a release, then there’d be more to talk about.