9 ms·
Announcing Rust 1.8
- manaskarekar 11y agoAnyone know of any real world applications using Rust? EDIT: https://github.com/kud1ing/awesome-rust https://github.com/kud1ing/awesome-rust I'm loving the pace of the release cycle! I don't think I can hold off the temptation to try it out - it's too shiny!
- steveklabnik 11y agoI gave a talk at a conference this week called "Rust in Production". Some of the companies I highlighted included Dropbox, Skylight.io, and well, Firefox ;) We're hoping to do more showing off of our production users in the future. Getting more production Rust in the wild is a big personal goal for me this year.
- aidenn0 11y agoIs Firefox using any rust in production yet?
- steveklabnik 11y agoI'm not on the platform team, but my understanding is that if you're on OS X or Linux, and you grab Firefox 45 right now, there's a _tiny tiny_ bit of Rust code in there. Windows will be in 46 or 47, IIRC? So it begins.
- tedmielczarek 11y agoIt will be in Windows builds in 47: https://bugzilla.mozilla.org/show_bug.cgi?id=1248461 https://bugzilla.mozilla.org/show_bug.cgi?id=1248461 . I don't think we intended to ship the Rust bits by default, but we didn't disable them for release builds, so there you go. It is pretty tiny, just a little bit of mp4 parsing code that (IIRC) we're running in parallel with the existing C++ code: https://dxr.mozilla.org/mozilla-central/source/media/libstagefright/binding/mp4parse https://dxr.mozilla.org/mozilla-central/source/media/libstag... If you run your Firefox from a console and browse sites that serve you shady mp4 files you can see the occasional panic message as it fails to parse something! :)
- mbrubeck 11y agohttp://bugzil.la/1243363 http://bugzil.la/1243363 is where Rust code was enabled for Firefox 45 beta/release on Linux and Mac. If I understand correctly, having it disabled on Firefox 45 beta broke the build because of a script that tests whether the beta build config matches the nightly config. This forced a decision, and release engineering opted to enable it. So it wasn't planned long in advance, but it was a conscious decision at the time 45 went to beta.
- tedmielczarek 11y agoThanks for digging that up. I recall having the discussions where we thought we'd let it bake for a while before it shipped, but I guess it was intentional, even if a bit last-minute. :) It's a pretty small bit of code right now, and it's not on the critical path for anything, so I don't think it's harmful.
- brobinson 11y agoIs there currently Rust code as part of Firefox, or are you talking about the expected future integration of Servo?
- steveklabnik 11y agoSee my response to your sibling.
- nachtigall 11y agoI think "Rust in Production" should be added to the FAQ. It does not seem to fit in with https://www.rust-lang.org/faq.html#how-does-mozilla-use-rust https://www.rust-lang.org/faq.html#how-does-mozilla-use-rust or the following question regarding large rust projects. Q: Which companies use rust in production? A: Dropbox, Mozilla, Skylight, OneSignal, etc with links to the relevant tech blog posts. I think there once was such a Q but it seems to have gone or I can't find it anymore.
- steveklabnik 11y agoWebsite stuff related to this is coming, don't worry.
- alexatkeplar 11y agoWe just released a data pipeline runner in Rust. Starting small but we have grand ambitions: https://github.com/snowplow/factotum https://github.com/snowplow/factotum
- steveklabnik 11y agoAh this is neat! I missed this somehow :)
- ekidd 11y agoIt's a really tiny thing, but Faraday uses https://github.com/faradayio/credentials_to_env https://github.com/faradayio/credentials_to_env to download secure credentials from a Vault server, and write them to environment variables or files. Alternatively, you can just pass in environment variables manually and ignore Vault (for testing, etc.). This acts as glue for existing programs that don't know about Vault. This is actual production code, even if it's really minor. The goal here was a single binary that would work on most modern Linux distributions, and which could make some HTTP calls and then exec another program, typically all from inside a Docker container. Rust was a bit overkill for this, but we already had a couple of the necessary libraries available from in-house experiments, and it was fun to write. The two best features of Rust for this project were: (1) If the program compiled, there was a 95+% chance it would work flawlessly on the first try, and (2) Cargo was really just lovely all around.
- tragic 11y agoSkylight[0] I believe uses rust to monitor rails apps. [0] https://www.skylight.io https://www.skylight.io
- nickpsecurity 11y agoCongratulations. Particularly, I think the Tier 1 i686 might get Rust more adoption by Windows C/C++ crowds in commercial sector. Improvements for large files in Linux might aid adoption in backup/archive and streaming servers. Just curious, did Dropbox's feedback have anything to do with that?
- kibwen 11y agoThe large file improvements were only needed on 32-bit platforms, and I'd assume that Dropbox's servers are all 64-bit.
- nickpsecurity 11y agoAlright,thanks. I was just curious if a single deployment on their level led to bugfixes or new features.
- kibwen 11y agoThe Rust team has been in constant contact with the Dropbox team (I should know, I coordinated and attended the original meeting), and I can say for certain that feedback from Dropbox has helped to prioritize and inform the stabilization of several features.
- nickpsecurity 11y agoCool, cool. I figured that would be the case. Tge idea behind the questions is kind of my exploration into the many eyes idea. It mostly covers feedback from widespread, random use. Howevet, I figured a small number of smart, industrial users stress-testing a new language/compiler might provide higher than average quality feedback than even twice as many casual developers. So my advice was to try to get such testers soon as key stuff is stable. Was the prediction accurate in that case? Sounds like it so far.
- jamwt 11y agoCorrect, they're all 64-bit linux. We might use some Rust on 32-bit soon though. So this is interesting to us.
- ultramancool 11y agoThey should probably change their terminology away from "RFC" for referring to Rust RFCs rather than IETF ones. Maybe RRFCs or REPs something? In this document is a perfect example of the problem, they list several Rust RFCs by RFC number, then talk about IP RFC based loopback detection, expecting everyone to know that RFC 6890 refers to an IETF one and not a Rust one. I mean, most of us can infer that just by length of the number, but it is pretty ambiguous especially when they're used in the same document like this.
- otoburb 11y agoI have the same thought running through my head while perusing each Rust announcement. Python has the Python Enhancement Proposal[1], and Bitcoin has their Bitcoin Improvement Proposal[2]. On the flip side, this does have the side effect of forcing me to click through to each Rust RFC linked in the announcements just to be sure. [1] https://www.python.org/dev/peps/ https://www.python.org/dev/peps/ [2] https://github.com/bitcoin/bips https://github.com/bitcoin/bips
- zanny 11y agoRIP in peace! (Rust Improvement Proposal)
- blktiger 11y agoEmber.js uses a similar naming convention. I'm not sure that it's that important to distinguish from IETF RFCs. Especially since the RFCs are linked in that document.
- sambe 11y agoI always thought RFC was generic (and/or predates IETF). Is that not true?
- wyldfire 11y agoIt is generic and does predate IETF but it's ambiguous to which reference material if the number ranges intersect.
- webkike 11y agoI've been using Rust more and more for my personal projects. Frankly, I could not give a hoot about the memory management; it's pretty cumbersome to deal with. What I love about Rust is that it's a low overhead language that uses interfaces. I love interfaces! I honestly think that they're the best way to program.
- chubot 11y agoWhat do you mean by that? Is it different than what you can do in C++ with inheritance (leaving out implementation inheritance)? I'm sure it is probably a little less verbose as the syntax in C++ is odd. C++ 11 adds 'override' which helps.
- webkike 11y agoNo, it is not. Pure virtual classes are the same as interfaces. But I only use pure virtual functions, so why mix in non-pure virtual classes?
- oconnor663 11y agoOne difference is that you can implement a new trait for someone else's type.
- pcwalton 11y agoI'm glad you like it :) I'm happy to see more emphasis on the productivity-related aspects of Rust. I talk about memory safety a lot because people ask questions like "what one feature makes you different from C++11?", but the productivity-boosting features like traits and Cargo are just as important in my mind.
- drbawb 11y agoThe importance of Cargo / crates.io cannot be understated, I think. I've found myself using Rust for little one-off tools and scripts lately because it's so darn easy to type `$ cargo new --bin foobar` on any of the three operating systems I use daily. There's already a pretty nice ecosystem of web servers, graphics libraries, crypto libraries, etc. -- Not to mention the bindings to existing libs. At the end of the day I always end up with wicked fast binaries that I can run on Windows, Mac, or Linux with fairly minimal fuss. --- I really haven't found a language that hits this niche the way Rust does, which is really strange to me considering Rust's mission statement. No shell scripting language is that easily portable barring something like MinGW. I've never had what I'd call a pleasant experience using Ruby, Python, or Javascript on Windows. Not to mention if the language runtimes / stdlibs don't demand it: many of the 3rd party libraries assume a *nix toolchain to build all the C extensions. Go and Java probably come the closest to writing easily portable software, but I personally find writing Rust to be a more fulfilling endeavor. --- The other day I wrote a tool to deduplicate my image library in Rust. The first binary to compile worked perfectly on both Mac OS and Windows, ran wicked fast (on my SSDs anyways), and it was really a pleasure to write. -- Rust's iterators alone really make for some beautiful code. --- This was a really long-winded way of saying I love Rust, and thanks for all the hard work ^^,
- Perceptes 11y agoIt's not mentioned in the post, but 1.8 also includes support for installing additional versions of the stdlib for other targets using rustup/multirust[1], which is huge for cross compilation: $ rustup target add x86_64-unknown-linux-musl info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl' 13.77 MiB / 13.77 MiB (100.00%) 1.47 MiB/s ETA: 0s info: installing component 'rust-std' for 'x86_64-unknown-linux-musl' Which allows: $ cargo build --target x86_64-unknown-linux-musl You can get a list of available targets with `rustc --print target-list`. [1] https://www.rustup.rs/ https://www.rustup.rs/
- steveklabnik 11y agoYeah, I didn't mention it in the post because rustup is still in beta. Once it's officially ready to go, trust me, I will start talking about it a lot :)
- 6d65 11y agoI wonder if in the long run it will be possible to generate an Android APK without having the Android NDK/SDK installed. Since it could link against the Android's stdlib. Though, I guess Android NDK uses a custom toolchain, linker, so it might not be that easily achieveable. Though it will give Rust an advantage over other newcomers. Crosscompilation for multiple OS'es/Architecture seems like a big selling point.
- steveklabnik 11y agohttps://users.rust-lang.org/t/psa-rustc-cargo-can-now-be-installed-on-arm-linux-netbsd-and-freebsd-using-rustup-multirust/5383/7?u=steveklabnik https://users.rust-lang.org/t/psa-rustc-cargo-can-now-be-ins...
- 6d65 11y agoYep. That's exactly what I was thinking about. Rust just keeps getting better and better.
- 11y ago
- EugeneOZ 11y agoFinally I'll switch to Serde JSON :) I use beta and beta is 1.9 today, with awesome features stabilized!
- thewhitetulip 11y agoI never got around to use Rust, maybe I'll get some good answers here on HN, how does Rust compare with Go/Python/Java?
- ghjnut 11y agoTutorial's pretty quick and gets you a good idea of what they're shooting for. https://doc.rust-lang.org/book/README.html https://doc.rust-lang.org/book/README.html
- ultramancool 11y agoRust is an entirely different paradigm than Go, Python or Java... It's sort of like C++ meets modern functional lanauges like Scala.
- vvanders 11y agoThings that I really like: -No GC, purely RAII based resource management. -Awesome ownership with first-class support for move semantics. -Great functional constructs(Sum Types, Pattern Matching and map()/filter()/etc). -Compiles down to native code via LLVM.
- anp 11y agoNitpick: GC is technically optional in Rust, because you can stick pretty much anything in a reference-counted box or an atomically-reference-counted box (Rc<T> or Arc<T>). It's not the default by any means though.
- vvanders 11y agoSure, much like C/C++ could have GC by embedding Lua, Spidermonkey, etc(fun fact Epic implemented their own C++ based GC for Unreal3). It's not a forced requirement :).
- masklinn 11y agoHell, > GC is technically optional in C++, because you can stick pretty much anything in a reference-counted pointer (shared_ptr<T>).
- deleted 11y ago[deleted]
- ysh7 11y agoGreat news!! Yet is vagrant a real contributor? Or someone messed up his git user.name?
- steveklabnik 11y agoIt's someone with a name 'vagrant' in their git info, yes. Not the company.
- cm3 11y agoAny word on linux-musl builds so that you can use official rust builds on alpine or void linux? Same question for FreeBSD builds.
- steveklabnik 11y agoRegarding BSDs: https://users.rust-lang.org/t/psa-rustc-cargo-can-now-be-installed-on-arm-linux-netbsd-and-freebsd-using-rustup-multirust/5383 https://users.rust-lang.org/t/psa-rustc-cargo-can-now-be-ins... We are still working on musl as a host, it's not there yet, in my understanding. Cross-compiling to it should be easy, but that doesn't help much if you're on Alpine.
- cm3 11y agoSo, I should be able to run rustup on FreeBSD 10/11 and it will install 1.8, right? If so, excellent!
- steveklabnik 11y agoI believe so, though I haven't tried it myself, I just know of that post :)
- cm3 11y agoWait, is this a different rustup than rustup the shell script?
- cm3 11y agoLooks like, and I take it that there are builds for freebsd and netbsd which the bootstrapping shell script will fetch and then have the rustup.rs executable for freebsd ready. Is that correct?
- steveklabnik 11y agoYes. I might as well take the time to elaborate on the history here. In the beginning, there was rustup. And it was good. Then, Rust matured, and we started the release channels. Now there wasn't just "Rust 0.9", there was Rust stable, beta, 1.0, 1.1... so many versions. rustup.sh wasn't really built to handle that. And so, multirust was born. mutlirust was/is a bash-based shell script that wraps up rustup and gives you the ability to manage multiple installs of Rust. And fun things like "this project uses rust stable, but this project uses Rust 1.1" and "please update every Rust I have installed". Stuff like that. But it was a bash script. Nobody knew that this whole Bash in Windows thing was happening. And we already have a perfectly good, general purpose programming language that runs on all the platforms Rust supports: Rust! So the multirust-rs project was begun, to re-write multirust in Rust. Once that started to become closer to being finished, we took a step back, looked holistically at all of this, and thought "If we started from scratch, what would we do?" https://public.etherpad-mozilla.org/p/rustup-new-experience https://public.etherpad-mozilla.org/p/rustup-new-experience And so, "rustup" was born. It's pretty much multirust.rs, but without trying to mimic the old multirust itself. There's still lots of stuff to do before it's ready to become the default way you manage rust installations: https://internals.rust-lang.org/t/beta-testing-rustup-rs/3316 https://internals.rust-lang.org/t/beta-testing-rustup-rs/331... and https://github.com/rust-lang-nursery/rustup.rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22initial+release%22 https://github.com/rust-lang-nursery/rustup.rs/issues?q=is%3... And of course, many people will want to use their system package manager too. Choice is good. They also play together. But that's for another post, this one is already getting long. You can find rustup here: https://www.rustup.rs/ https://www.rustup.rs/
- mtgx 11y agoAnything big (bigger than usual) planned for 2.0?
- nemaar 11y agoAfter 1.9 1.10 will come. There is no plan for 2.0
- steveklabnik 11y agoYup. There's even one cool feature we already know will be in 1.10: stable bootstrapping. You'll be able to build Rust 1.10 with Rust 1.9. And Rust 1.11 will build with 1.10. And so on and so on. This should help packagers significantly.
- kibwen 11y agoIs there a tracking issue for this?
- steveklabnik 11y agoNo, just a PR: https://github.com/rust-lang/rust/pull/32731 https://github.com/rust-lang/rust/pull/32731
- harveywi 11y agoDoes anyone have any information about when/if we will see support for higher-kinded types in Rust? There is the RFC thread on Github (https://github.com/rust-lang/rfcs/issues/324 https://github.com/rust-lang/rfcs/issues/324), but I haven't been following the trajectory very closely, and a quick synopsis would be wonderful and appreciated.
- kibwen 11y agoHigher-kinded types are a far-future enhancement. There are several language-level features that I would expect to be prioritized far above HKT; off the top of my head: specialization (an early prototype implementation of this is in nightly), placement-new, type-level numerics, stabilized syntax extensions, and non-lexical borrows. Of those, all but the last is for the sake of runtime efficiency, whereas HKT is just about genericity and expressiveness (neither of which Rust extremely prioritizes, at least not relative to languages like Haskell).
- vbit 11y agoBTW, does rust come with some kind of ide support tools, e.g. a commandline tool for autocomplete?
- hokkos 11y agoNot natively for now, but racer can do it : https://github.com/phildawes/racer/ https://github.com/phildawes/racer/ IDE is a current goal : https://www.rust-lang.org/ides.html https://www.rust-lang.org/ides.html
- 0X1A 11y agoI haven't quite looked but is there a timeline for when compiler plugins will be stabilized? Interested in using serde but would prefer using macros
- steveklabnik 11y agoNot an exact timeline, but it's something that's being actively worked on. There's even an RFC: https://github.com/rust-lang/rfcs/pull/1566 https://github.com/rust-lang/rfcs/pull/1566
- optforfon 11y agoA few days ago I posted a comment with my problems with C. Can you use Rust as a better C/cross-platform-assembly? does it have native support for - vectorization/SIMD - hinting at likely branches - prefetching memory - forcing or blocking inlining and all the magic in gcc C extensions
- alkonaut 11y agoManual SIMD intrinsics is getting there, not sure how far it has come by now: https://github.com/rust-lang/rust/pull/27169 https://github.com/rust-lang/rust/pull/27169 I'm sure LLVM does a fair bit of vectorization under the hood too of course, but not sure whether better knowledge of aliasing lets it do more or whether less undefined behavior sloppyness in Rust lets it do less of it than for C++. Branch hint intrinsic: an accepted RFC but not yet implemented https://github.com/rust-lang/rust/issues/26179 https://github.com/rust-lang/rust/issues/26179 Prefetch intrinsic: Looks like a rejected rfc https://github.com/rust-lang/rfcs/pull/125 https://github.com/rust-lang/rfcs/pull/125 Inlining: As far as I understand the attributes are #[inline(always)] and #[inline(never)] respectively.
- optforfon 11y agoThanks for the links! This info is kinda hard to find if you're not in the loop. But it looks like low level optimization is a low priority for the Rust project at the moment. (prefetch is rejected b/c of insufficient testing and branch hinting might get hampered b/c Rust developers aren't trusted to use them correctly) Maybe I'll revisit it in the future! Appreciate the help =)
- quotemstr 11y agoDoes Rust still abort on OOM? I won't use it by choice while it does that.
- steveklabnik 11y agoThat's the standard library, not the language. You can use whatever semantic you want if you don't use the standard library, which is very easy to do.
- quotemstr 11y agoAnd since most programs in any language will use that language's standard library (since that's the point of having a standard library), Rust systems in practice will not tolerate memory exhaustion. This property renders the whole system unacceptable to me.
- steveklabnik 11y agoThere is already an ecosystem of packages for OS development even, and we statically know if you use the standard library or not. Many libraries that don't require it have an option to turn it off. I understand your skepticism, but we care about this use case and are working to make it easy.