7 ms·
What is Rust 2018?
- hinkley 8y agoIME we put far too much gravity on 1.0 and 2.0. If you’re building a team to last, you’ll be at 3.0 before you know it. If you didn’t, you’ll be out of business before it happens. I know which team I want to work with...
- sbjs 8y agoIt's interesting that Rust is starting to use the same version-naming scheme that ECMAScript and Ubuntu did, being year-based. Personally I think Ubuntu's naming scheme and release schedule is the best, releasing $N times per year and naming it $YY.$N, where N is the same each year. This has a host of benefits: it's obvious how old any given version is, it's predictable when a new version will be released, it helps prevent development from stalling for any reason, especially unnecessary-rewrites and way-too-big-features, and more!
- steveklabnik 8y agoECMAScript was certainly a huge influence here; TC39's influence may go even farther in the future: http://smallcultfollowing.com/babysteps/blog/2018/06/20/proposal-for-a-staged-rfc-process/ http://smallcultfollowing.com/babysteps/blog/2018/06/20/prop... What's funny is, it kinda goes both ways: I've recently spent a bunch of time talking to some TC39 members, and they have been talking a lot about a roadmap process that kinda looks like ours, while we've been talking about making our RFC process be a little closer to the "staged" concept that they have. Very interesting times! Most importantly though, it had a lot of influence because they have similar stability constraints as we do; I mentioned C++ and Java in the post, but maybe should have mentioned ECMAScript as well.
- nothrabannosir 8y agoUbuntu's release names are not $YY.$N but $YY.$M (as in month), fwiw. Agreed that it's a great scheme.
- xyzzy_plugh 8y agoAnd for a while now, even numbered years released in April are always LTS. No surprises.
- dmoreno 8y agoAKA calendar versioning. I also love it. http://calver.org/ http://calver.org/.
- eindiran 8y agoInteresting, I did not know that this was a thing. That document lays out some of the potential advantages quite well.
- ameliaquining 8y agoRust's version numbering is semver-based and will remain so. The year-based scheme is for epochs, which are mostly orthogonal to versions (each new epoch will require the latest version, but each new version will support every existing epoch). Rust does follow a time-based release schedule, though (a new stable release every six weeks), and it does have many of those advantages.
- stochastic_monk 8y agoThe thing keeping me from Rust is the weaker metaprogramming relative to C++. Do you have plans to expand Rust to things like compile-time expressions, template templates, and perfect forwarding?
- steveklabnik 8y agoWe do! We've been pretty quietly developing it, but right now, the Rust compiler contains a full interpreter as well, specifically to do compile-time evaluation. But, we also do not want to have unlimited compile-time facilities, as that has serious soundness problems. "const fn" is the name of the user-facing feature, and MIRI is the underlying interpreter, if you want to do some searching. That said, that work tends to fall under "compile time expressions"; "template templates" are more likely to be served by some sort of eventual HKT, or maybe even by ATC. I always forget what perfect forwarding is so I probably shouldn't comment on it. I am willing to bet that this stuff is a major part of next year's roadmap, but we'll see!
- Sharlin 8y agoFor the uninitiated, HKT means higher kinded types, which is the type theoretic term for what C++ calls template template parameters. That is, the possibility to pass around type-level functions. I don't know what ATC refers to.
- steveklabnik 8y agoYes, thank you! ATC is "associated type constructors". I believe Haskell calls them "type families"? It's sort of a similar idea; a form of higher-kindness. We are likely to get ATC in the medium term, but full HKT is farther out.
- Sharlin 8y agoRight, thanks! It sounded familiar but google revealed nothing. Should have tried "atc rust".
- deleted 8y ago
- samueldavid 8y agoI'm afraid of rust adding too many features for its own good like c++ did..
- faitswulff 8y agoHaving not started on learning rust yet, I am worried about the complexity increasing as well. However, I think the idea of editions is that you can stick with one if you like, for as long as you like.
- seeekr 8y agoIf anything, then the complexity is getting less, not more, as the team as well as the ecosystem are very much focused on making things simpler and more approachable and are very aware of any existing, potentially unnecessary complexity. As an example, the borrow checker is currently undergoing a major (internal) revision and will allow you to write some things in the future (and even now, at least on nightly Rust) that its old implementation was not so sure about and thus complained about. Another example: async/await syntax is coming, along with improved futures, that will make it much easier to get started with async/io programming.
- steveklabnik 8y agoWe don't just add things for the sake of adding them. Most new features are being driven by two things: 1. Making the language friendlier for beginners and easier to understand. 2. Addressing pain points by production users. That being said, I'd push back a little on "number of features" as a measure of complexity. There's a few ways in which this is a problem. For example, the "waterbed theory of complexity", that is, if you make the language simpler, you push the complexity elsewhere. This can be good or bad, depending. I generally hesitate to compare Rust to other languages, but there was a good illustration of this the other day, about Rust and Go: https://news.ycombinator.com/item?id=17618918 https://news.ycombinator.com/item?id=17618918 Basically, Go has kept the language incredibly simple. Rust has added many features that Go does not. But that means that error handling in Go is significantly more verbose than in Rust. You can't just wave away the inherent complexity of properly handling errors; it has to go somewhere. Both choices are 100% valid, just different. The other big issue with simply enumerating features is that cohesion and orthogonality is important. C++ did something truly impressive; they changed the fundamental model in which you write code. Idiomatic C++98 and idiomatic C++17 look and feel very different. The cost of this is that many features don't quite fit together as well as you would like. Or at least, that's what people say. We try to really make sure that features fit together in a way that makes sense. Time will tell if we succeed.
- egnehots 8y agoI thought, yeah that's just feature gated stuff. It's just marketing but my code will break even if I don't use the new edition because my dependencies will use it. Turn out that it's false. What's amazing is that the compiler ensures that projects using the legacy edition can still use libraries relying on the new edition. that if you’re using Rust 2018, you can use dependencies that use Rust 2015 with zero problems. If you’re sticking with Rust 2015, you can use libraries that use Rust 2018. It all works together That's great!
- epage 8y ago> Turn out that it's false. What's amazing is that the compiler ensures that projects using the legacy edition can still use libraries relying on the new edition. To add on top of this is the amazing work to make this work even for Macros!
- xfer 8y agoNot sure why you would think that, it also works the same in C/C++ world.
- epage 8y agoYes, most C++ compilers let you specify your language version. One of the problems with C++ is there is less of a dependency management story around it. - Maybe staticlibs will let you mix language versions? - Maybe DLLs will (granted you probably shouldn't have C++ in your ABI anyways)? - headers-only or vendored libraries won't allow mixing language versions. Contrast this with Rust where all of the standard approaches for declaring a dependency allow different language editions.
- pcwalton 8y agoNot really, because libraries have headers that have to be textually included into your source. Because they're pasted in as far as the compiler is concerned, you have to pick one version of the language to compile your app and all the included headers with.
- the_why_of_y 8y ago
- reificator 8y agoAn interesting approach to fixing and changing without breaking backwards compatibility. Time will tell if it lives up to its promises, but I'm intrigued... The closest I've seen to this model is "use strict", but having this at the package level is a nice quality of life improvement.
- ilovecaching 8y agoI'm really loving Rust. I've been 100% C++ dev for work, and Rust is starting to gain internal traction. Go fell over as a replacement for our less resource intensive applications because the lack of generics killed interoperability between it and C++. Rust wins in that area. My only fear would be Rust continuing to tack on features without every removing anything and turning into C++ 2. C++ 17 is still really nice, the language is just old and C compat + lots of historically bloat makes it crusty. A better type system with more FP concepts and more safety is a win-win in my book.
- senorsmile 8y agoI'm curious. What sort of features would you not want to see in Rust?
- remram 8y agoCan't talk for the parent, but things like ..=, impl Trait (especially for arguments), new try/catch syntax, ... were pretty controversed (and that's among the accepted RFCs only).
- pornel 8y agoThese controversies were mainly bikeshedding names and syntax (vs `...`, `any Trait`, `do/fail`), but there was little opposition to the features themselves. There are some often-requested features (specialization, const generics, box syntax, placement new) that even got implemented, but are still unstable, because they aren't good enough. The bar is high. Plenty of RFCs get rejected: https://github.com/rust-lang/rfcs/pulls?q=is%3Apr+is%3Aclosed+RFC https://github.com/rust-lang/rfcs/pulls?q=is%3Apr+is%3Aclose... and even more "pre-RFCs" don't even make it past initial discussion in the forums. I think Rust is getting better over time in making ideas polished. The few warts it has so far (e.g. Error description() and cause(), struct literal parsing in `if`) are from before 1.0, and probably wouldn't get past the RFC process used today.
- blub 8y agoWhat do you mean by C++ interoperability (re Rust)? As far as I was able to determine a couple of months ago, there isn't really a good way of doing interop except by going through a C shim. The case I was analysing was Qt C++ UI plus Rust library. There's a Rust text editor (xi?) which is using JSON to communicate between the UI and the core. In that case I believe it was designed like that to allow for different UIs, but it looks more appealing than the C interface.
- baby 8y agoI got into Rust recently and I have to say I like it. The syntax is a bit noisy to my taste (generics, lifetimes and macros) but overall I really like it. It seems like it's maybe not a good idea to get too much into it though, the language seems to move a lot, there are still a lot of things that are not here (a rand library, benchmarks) or are subject to change. I'm not sure if I should give it more of my time.
- steveklabnik 8y agoWe do have the rand crate, and whole built-in benchmarks aren’t stable, the bencher crate does port them to stable Rust. While we do add stuff a lot, we don’t break old things, so what you learn is still going to work!
- Thiez 8y agoExcept for the breaking changes every edition, of course.
- steveklabnik 8y agoBecause those are opt-in, they will never break your existing code.
- ThJ 8y agoI have one sore spot about Rust: The Rust build tools are almost unusably slow on small ARM devices like the Raspberry Pi Zero. I can compile a simple C++ program just fine on such a device, but Rust will take ages building dependencies and requires a swap file because it eats up all the physical memory. Meanwhile, in C++ land, my distribution's package manager includes prebuilt C++ libraries and headers. I tried cross compilation but that was a nightmare to set up, and got even worse when Cargo packages depended on C libraries, which then also had to be cross compiled. In the end, I was unable to get it working, and had to give up my attempt at targeting that platform with Rust.
- iknowstuff 8y agoCross-compilation should be much easier when rust starts using the lld linker. You can try it out now by building a statically-linked musl binary in nightly. rustup target add arm-unknown-linux-musleabihf RUSTFLAGS='-C linker=rust-lld -Z linker-flavor=ld.lld' cargo +nightly build --target arm-unknown-linux-musleabihf