Live data from Hacker News

Rust's 2018 roadmap

blog.rust-lang.org

51–60 of 253 posts

Re: Rust's 2018 roadmap

#51
post #4

Go is making a large push to wasm as well. There is a branch/fork with a near complete wasm Go compiler. I'm interested in seeing how Rust and Go will compare in the future of the web. Who will win? ;)

Let me throw Nim into the mix and say that it has had a JS backend for years now. It's officially supported so it's very stable.

Native WASM support isn't there yet, but if you want extra speed you could combine Nim's JS backend and Nim's C backend + emscripten to compile to WASM. You can see this approach in action in a game called Reel Valley [1][2]. The advantage is that you can access the DOM from Nim using the JS backend (you cannot do that in WASM yet AFAIK).

1 - https://www.youtube.com/watch?v=DmMOIVUeUrE

2 - https://www.facebook.com/reelvalley/

Re: Rust's 2018 roadmap

#52
Heres just hoping that Mozilla is prepared to take responsibility for what they are trying to accomplish in the long haul.

A lot of companies have tried to make products that are both infinitely backwards compatible and always supported while still introducing breaking changes like this. It quickly becomes a giant internal mess of trying to figure out what the most common denominator of feature requirements to implement new things is. Developers will start making ergonomic decisions in their changes (well, it could support 2021, but I want a 2024 feature so I'm going to use it and peg this feature to 2024 minimum) and new changes need to be tested against every different language iteration.

This might seem like the best answer now, I just hope its not biting off more than anyone can chew in 2030. C++ had an era of malaise where conflicting implementations of the standard library across a dozen+ platforms led to the complete abandonment of it by the mid 2000s and it took Herb Sutter and friends to bring C++ back from the dead with one unified single truth of C++ with concrete compiler flags and tons of caution before adopting anything new to make sure all participants were capable of fielding it quickly enough to avoid the ecosystem fragmentation of the past.

Rust is advantaged today with only one major implementation, but if mrustc or other alternative Rust compilers become popular mixing those with epochs / eras / editions can spell disaster for language portability.

Its not an impossible task, but it is definitely a huge one. And its not the kind of work hobbyists will ever be willing to put up with in the long term, and its the kind of work that requires extraordinary familiarity with the whole of rustc, its design process, the RFCs, LLVM, etc. Its its opposite kind of work to what you put on the easy issues list for new contributors.

It is the primary reason why most software staggers its releases and depreciated support. Why Microsoft dropped Windows XP at all despite its wide adoption. Because even with billions of dollars of cash on hand trying to keep multiple parallel interconnected but distinct code paths functioning while both securing and improving them in isolation or together is in the highest echelons of software complexity and difficulty.

Re: Rust's 2018 roadmap

#53
post #11
post #10

Looks neat. Any notes on const generics e.g.`Array[T, N]`?

The tracking issue for const generics is here: https://github.com/rust-lang/rust/issues/44580

As far I understand the RFC won't allow for `Array[Y, N]` (or `Array` in Rust parlance) note eddyb's comment:

     Note that all of this should allow impl Trait for [T; N] {...}, 
     but not actually passing a constant expression to a type/function, e.g. ArrayVec.
What I'm actually looking is `Array>` for support for data structures that vary depending on size of `T`.

Re: Rust's 2018 roadmap

#54
post #19

Earlier quoted context omitted.

GC's have some kind of inherit reference counting which makes releasing pointers safe, in any direction. You can't do that with C/C++ without something like glib.

If you have reference counting across GC boundaries, you can easily create memory leaks because of reference cycles, e.g. GC 1 cannot release object 1 because it references object 2, and vice versa. (Unless you only allow refs to go one way.)

Great now I get flashbacks to 2005.

IE6 had exactly that issue, the DOM was implemented using COM which has its own GC (refcounting) separate from the regular JS runtime.

If you created a cycle between DOM and JS by, let's say, adding an event handler to a DOM node — thankfully that's something you'd never do when developing web pages & applications — you'd start leaking memory which would survive across page reloads.

There was actually a bit of software called Drip, it was just a webview wrapper (technically an MFC app with a browser COM component), you'd launch it, open your page, click the "blow memory" button and it'd reload the page over and over again listing elements which had survived between reloads.

Re: Rust's 2018 roadmap

#55

Lots of nice language improvements lined up for this year I haven't played with Rust but I like the ecosystem and transparency. Something that stands out is the Compatibility across editions section. Seems like they really thought this through: > you can be on a different edition from your dependencies. > Edition-related warnings...must be easily fixable via an automated migration tool (rustfix). Only a small minorit…

Editions sound like an interesting riff on C/C++'s standards thing. The post isn't really clear what will be gated behind editions though, only non-BC syntactic changes (e.g. literally just new keywords)?

Currently:

- new keywords https://internals.rust-lang.org/t/keywords-to-reserve-for-ru... . There are a lot, but not all of them may end up being used, this is conservatively reserving them. In case a crate on a previous edition has e.g. a method called `catch`, you can still call it via the "raw identifier syntax", `foo.r#catch()`

- you can no longer call methods on raw pointers that do not have a fully concrete type in the new epoch. E.g. `foo.is_null()` won't work if `foo` is `const T` and `T` isn't fully known. (This paves the path for `self: const Self`, which may be introduced later).

Re: Rust's 2018 roadmap

#56

Earlier quoted context omitted.

Editions sound like an interesting riff on C/C++'s standards thing. The post isn't really clear what will be gated behind editions though, only non-BC syntactic changes (e.g. literally just new keywords)?

Yeah, this post is intended to be a high-level explanation, so we didn't dig into the details. I left a comment below about this: https://news.ycombinator.com/item?id=16569751

OK so non-BC syntactic changes, and warning -> error transitions. Didn't think about the second one but that's way cool.

Still, I think it's short and simple enough that it could have been noted in the section, which I feel currently talks about editions a lot but doesn't say much about them.

Re: Rust's 2018 roadmap

#57

Lots of nice language improvements lined up for this year I haven't played with Rust but I like the ecosystem and transparency. Something that stands out is the Compatibility across editions section. Seems like they really thought this through: > you can be on a different edition from your dependencies. > Edition-related warnings...must be easily fixable via an automated migration tool (rustfix). Only a small minorit…

Editions sound like an interesting riff on C/C++'s standards thing. The post isn't really clear what will be gated behind editions though, only non-BC syntactic changes (e.g. literally just new keywords)?

I assumed that the "edition" thing is just an indirect reference to v1.28 or v1.29, just like some linux distros tag the LTS acronym on long term support releases to differentiate them from subsequent intermediate releases. No jab needed, just a codename to refer to the minor version which will be handled as the most stable release and serve as a line in the sand regarding what represents the go-to version for long term projects.

Re: Rust's 2018 roadmap

#58
post #52

Heres just hoping that Mozilla is prepared to take responsibility for what they are trying to accomplish in the long haul. A lot of companies have tried to make products that are both infinitely backwards compatible and always supported while still introducing breaking changes like this. It quickly becomes a giant internal mess of trying to figure out what the most common denominator of feature requirements to implem…

So, two things:

> Heres just hoping that Mozilla is prepared

Rust is an open source project Mozilla contributes to heavily, it's not a Mozilla project. This is the Rust project's problem, not Mozilla's problem.

(For example, Mozilla employees, of which I am one, are a minority in governance these days. We're the largest single group of people by employer, but are at 50% representation on the core team and are something like between 10%-20% of the rest of the teams, which have just as much jurisdiction over Rust as the core team does.)

> It quickly becomes a giant internal mess

This is why, as noted elsewhere in the thread, editions can only tweak the frontend of the compiler. By the time you hit MIR, the main intermediate representation, all edition differences are gone. This is for both compilers and humans. As you rightfully say, if we allowed arbitrary changes, it could significantly increase technical debt. But it'd also be very hard for humans to understand as well. We won't be fundamentally changing what Rust is for these reasons.

Re: Rust's 2018 roadmap

#59
post #17

You may have noticed a subtle change: what was previously called “epochs” is now “editions.” Lots of great stuff coming this year! As always, happy to answer any questions.

Could this be used to add an "Ord::clamp" or similar to the stdlib such that it's invisible (and thus wouldn't cause any conflict) to crates with an older "edition"?

I think for such things it's preferable to just have a `clamp` method as a static method, i.e. you call it with `Ord::clamp(foo, bar)` instead of `foo.clamp(bar)`.

But yes, it could.

Generally the trend seems to be to still try to avoid having actual breakages in the editions unless we _have_ to, and this seems like one of those cases where we don't.

That said, adding Ord::clamp doesn't technically count as a breakage for Rust, Rust's stability guarantee does not include "we added a method to this trait/type and now you have to disambiguate via UFCS" or "we added a thing to this module and now you have to alias your import" because it's not really possible to have that stability guarantee and continue to evolve the stdlib.

That said, given that Ord is in the prelude, the bar for adding stuff to that is much higher. And Rust also cares about the impact of not-technically-breaking changes like these, so we definitely wouldn't just add it as a method.

Re: Rust's 2018 roadmap

#60

Earlier quoted context omitted.

Editions sound like an interesting riff on C/C++'s standards thing. The post isn't really clear what will be gated behind editions though, only non-BC syntactic changes (e.g. literally just new keywords)?

I assumed that the "edition" thing is just an indirect reference to v1.28 or v1.29, just like some linux distros tag the LTS acronym on long term support releases to differentiate them from subsequent intermediate releases. No jab needed, just a codename to refer to the minor version which will be handled as the most stable release and serve as a line in the sand regarding what represents the go-to version for long t…

Rust 1.29 (for example, not committing to a particular release here) will be able to compile both editions worth of code. Rust 1.300 will still be able to compile Rust 2015.

LTS is an entirely different axis. LTS is about artifacts, editions are about the language.

I'd really like to see us start an LTS policy this year, but we'll see.

Post reply on HN