Stream: wg-traits

Topic: weekly meeting 2018-12-17


scalexm (Dec 17 2018 at 18:26, on Zulip):

@nikomatsakis is there a meeting this evening?

nikomatsakis (Dec 17 2018 at 19:02, on Zulip):

@scalexm I was just coming :)

nikomatsakis (Dec 17 2018 at 19:03, on Zulip):

cc @WG-compiler-traits -- brief meeting?

nikomatsakis (Dec 17 2018 at 19:03, on Zulip):

@scalexm I've been reading your PR (at long last!)

Alexander Regueiro (Dec 17 2018 at 19:03, on Zulip):

sure

nikomatsakis (Dec 17 2018 at 19:03, on Zulip):

I was hoping, if people are around, to talk a bit briefly about the next year

Alexander Regueiro (Dec 17 2018 at 19:03, on Zulip):

not sure I can contribute much right now though

nikomatsakis (Dec 17 2018 at 19:03, on Zulip):

(I imagine we won't have a meeting next week)

Alexander Regueiro (Dec 17 2018 at 19:03, on Zulip):

yeah

Alexander Regueiro (Dec 17 2018 at 19:03, on Zulip):

Chrismtas Eve and all

nikomatsakis (Dec 17 2018 at 19:04, on Zulip):

but I'm hoping that starting in January 2019 I can start to devote more dedicated time to traits etc. I'm not sure what that should mean yet

Alexander Regueiro (Dec 17 2018 at 19:04, on Zulip):

nice

Alexander Regueiro (Dec 17 2018 at 19:04, on Zulip):

upcasting and multi-traits! :-D

Alexander Regueiro (Dec 17 2018 at 19:04, on Zulip):

I pinged you in the channel where @dhardy and I were talking about it.

nikomatsakis (Dec 17 2018 at 19:04, on Zulip):

I saw that, haven't had time to follow up yet

nikomatsakis (Dec 17 2018 at 19:05, on Zulip):

I'm not sure what exactly to discuss, I guess it's a lot of the same questions as ever

Alexander Regueiro (Dec 17 2018 at 19:05, on Zulip):

no worries. in your own time

nikomatsakis (Dec 17 2018 at 19:05, on Zulip):

but actually having I think a kind of list of "goals" would be a good 1st step

Alexander Regueiro (Dec 17 2018 at 19:05, on Zulip):

yes, it's the same questions as before... although @dhardy had some more specific ones I think, which I couldn't answer.

nikomatsakis (Dec 17 2018 at 19:06, on Zulip):

I wonder if it makes sense to create a repository (or perhaps use some part of https://github.com/rust-lang/compiler-team/) to track this sort of thing

tmandry (Dec 17 2018 at 19:06, on Zulip):

since I've been out of the loop for a bit.. what's the status on chalkification?

Alexander Regueiro (Dec 17 2018 at 19:06, on Zulip):

I'm not hugely fond of the rfc-repo idea but... would some notes, then a pre-RFC or such work?

nikomatsakis (Dec 17 2018 at 19:06, on Zulip):

the status is that @scalexm has opened #56384 but I've been slow to review

Alexander Regueiro (Dec 17 2018 at 19:06, on Zulip):

after which an RFC can come finally

Alexander Regueiro (Dec 17 2018 at 19:07, on Zulip):

@nikomatsakis would appreciate some advice on what to do about that future compat warning for my trait aliases PR btw... I think that should become a regular lint, but we should leave a future compat warning in place for the coherence case? I'm not sure how to do it for coherence though, sounds kind of difficult.

nikomatsakis (Dec 17 2018 at 19:07, on Zulip):

if there were to be a repository, I was thinking more of a higher-level one, just collecting all the things that the working group is trying to do

Alexander Regueiro (Dec 17 2018 at 19:07, on Zulip):

fiar enough

nikomatsakis (Dec 17 2018 at 19:09, on Zulip):

@nikomatsakis would appreciate some advice on what to do about that future compat warning for my trait aliases PR btw... I think that should become a regular lint, but we should leave a future compat warning in place for the coherence case? I'm not sure how to do it for coherence though, sounds kind of difficult.

ok ye I can do that today

tmandry (Dec 17 2018 at 19:09, on Zulip):

that could work

nikomatsakis (Dec 17 2018 at 19:10, on Zulip):

one of the things I'm thinking about

nikomatsakis (Dec 17 2018 at 19:10, on Zulip):

is trying to do a kind of survey

tmandry (Dec 17 2018 at 19:10, on Zulip):

it begs the question, where should tracking issues live? rust repo vs here?

nikomatsakis (Dec 17 2018 at 19:11, on Zulip):

basically I'm wondering about which features are most important and for what, and if -- for those -- there exist shortcuts to implementing them. I really want to push on chalk integration but I am wary that it may take some time before it's all competitive and full-featured

nikomatsakis (Dec 17 2018 at 19:11, on Zulip):

so I guess I'm just thinking about trying to get a "high-level feeling" for the scope of the goals and try to organize them somewhat

nikomatsakis (Dec 17 2018 at 19:11, on Zulip):

(e.g., withoutboats was asking me about async fn in traits recently)

centril (Dec 17 2018 at 19:12, on Zulip):

@nikomatsakis GATs are the most important thing ever of course :slight_smile: (by several orders of magnitude...) ^.^

scalexm (Dec 17 2018 at 19:12, on Zulip):

well

nikomatsakis (Dec 17 2018 at 19:12, on Zulip):

@centril that is not clear to me

scalexm (Dec 17 2018 at 19:12, on Zulip):

I don't know a lot of trait-related features that are blocked on chalk apart from GATs basically

tmandry (Dec 17 2018 at 19:12, on Zulip):

I think those would have to be prioritized pretty ruthlessly by opportunity cost of working on chalk vs immediate benefit

nikomatsakis (Dec 17 2018 at 19:12, on Zulip):

(but maybe so)

centril (Dec 17 2018 at 19:13, on Zulip):

@nikomatsakis well; at least personally, GATs are consistently the #1 thing that I frequently need that makes me go "nope, just give up... can't make progress"

tmandry (Dec 17 2018 at 19:14, on Zulip):

async fn in traits is just existential types?

nikomatsakis (Dec 17 2018 at 19:14, on Zulip):

@scalexm lazy norm, perhaps, and implied bounds — but maybe not. I guess that's part of the question.

scalexm (Dec 17 2018 at 19:14, on Zulip):

@tmandry yes but they often need to be generic over a lifetime (for a method taking &self for example)

nikomatsakis (Dec 17 2018 at 19:15, on Zulip):

async fn in traits is just existential types?

it depends on how "purely" you want to do it. It would be best modeled with GATs and some existential support, but we might be able to do a more "focused" version

nikomatsakis (Dec 17 2018 at 19:15, on Zulip):

special-cased

nikomatsakis (Dec 17 2018 at 19:15, on Zulip):

but that is what I am bit wary of

nikomatsakis (Dec 17 2018 at 19:15, on Zulip):

the other "feature" of traits is perhaps "performance", which I still feel can be vastly improved via the more aggressive caching that chalk permits etc, but I think that may take some time to prove out (and could be wrong)

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

@centril yes, fair. Mostly I am wondering if some kind of async fn implementation might be as important.

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

ps, @scalexm I'd like to try and land your PR before the holidays, are you available to rebase etc these days?

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

I see you recently rebased it

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

(I can also do that if needed)

tmandry (Dec 17 2018 at 19:16, on Zulip):

my feeling is it's hard to have a nuanced conversation about this without an idea of what such a special-cased version would look like..

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

yes I don't really want to have that conversation now

scalexm (Dec 17 2018 at 19:16, on Zulip):

@nikomatsakis I should be available in the evenings (my time) yes

nikomatsakis (Dec 17 2018 at 19:16, on Zulip):

I mostly wanted to get an idae of the "end user things" we want to enable and try to take some time to think about what's really the best path for each of them

centril (Dec 17 2018 at 19:17, on Zulip):

@nikomatsakis I mean; for many people async fn is really important; but it's less a general type system feature which pervasively makes everything better and more a focused domain specific thing

centril (Dec 17 2018 at 19:18, on Zulip):

besides, async fn semi-depending on GATs is a reason to focus on GATs...

re. performance... isn't most time spent in code-gen anyways?

nikomatsakis (Dec 17 2018 at 19:18, on Zulip):

I wonder if it makes sense to literally do some sort of survey

tmandry (Dec 17 2018 at 19:19, on Zulip):

so, do we want to prioritize shipping a really polished async feature, or letting things take their course and ending up more good things in the end, a little sooner

nikomatsakis (Dec 17 2018 at 19:19, on Zulip):

or perhaps an internals thread makes more sense. I guess the real question is what the questions are

nikomatsakis (Dec 17 2018 at 19:19, on Zulip):

maybe neither

nikomatsakis (Dec 17 2018 at 19:21, on Zulip):

@centril re: performance, it all depends what you're doing, but trait matching can be a significant cost in many scenarios. Some of my measurements put it at about 30% of e.g. serde build time, though I think those measurements are a touch suspect because of incomplete debuginfo

nikomatsakis (Dec 17 2018 at 19:22, on Zulip):

but certainly cargo check is not spending time in LLVM =)

centril (Dec 17 2018 at 19:22, on Zulip):

sure; check is usually pretty fast tho imo :P

tmandry (Dec 17 2018 at 19:22, on Zulip):

based on my wording above, my feeling is this boils down to a higher-level strategic question that could use guidance from core team or more general rust community

nikomatsakis (Dec 17 2018 at 19:22, on Zulip):

I'm wondering

nikomatsakis (Dec 17 2018 at 19:22, on Zulip):

I think it's a combination

centril (Dec 17 2018 at 19:23, on Zulip):

@nikomatsakis what does async fn need implied bounds for?

nikomatsakis (Dec 17 2018 at 19:23, on Zulip):

like, the technical details matter, I don't think we are under such heavy time pressure on any thing that we want to take on a lot of technical debt necessarily

tmandry (Dec 17 2018 at 19:23, on Zulip):

right

nikomatsakis (Dec 17 2018 at 19:24, on Zulip):

so I am guessing that the place to start is this:

I think e.g. the trait object + alias stuff that @Alexander Regueiro has been pursuing is really great, and not something that was originally on my radar

nikomatsakis (Dec 17 2018 at 19:24, on Zulip):

what does async fn need implied bounds for?

there's no particular connection

nikomatsakis (Dec 17 2018 at 19:24, on Zulip):

it's just that implied bounds need chalk

nikomatsakis (Dec 17 2018 at 19:25, on Zulip):

but omg they would be so nice sometimes ;)

nikomatsakis (Dec 17 2018 at 19:25, on Zulip):

/me has gotten sick of copying and pasting where clauses all over the place

tmandry (Dec 17 2018 at 19:25, on Zulip):

I think there is also a lot of value in finishing things and sometimes that needs to be a priority

tmandry (Dec 17 2018 at 19:26, on Zulip):

so we should definitely keep that in mind imo

nikomatsakis (Dec 17 2018 at 19:27, on Zulip):

so let's see, what is the list? here is a hackmd document with some preliminary thoughts: link

centril (Dec 17 2018 at 19:27, on Zulip):

OK; I'll say a few things: 1) I'm not inclined to stabilize trait aliases until we at least have ConstraintKinds on nightly for some time (and it hasn't even been designed / rfc-accepted); 2) same with implied bounds but instead with where bounds on enum variants since implied bounds makes all APIs not able to move to more relaxed constraints (it's a breaking change); 3) specialization needs redesign;

nikomatsakis (Dec 17 2018 at 19:28, on Zulip):

actually, just making that list and trying to sketch out what is needed for each category is pretyy interesting

tmandry (Dec 17 2018 at 19:29, on Zulip):

also, I suspect finishing chalkification should make it easier to iterate on a lot of things we're talking about

tmandry (Dec 17 2018 at 19:29, on Zulip):

but I may be misguided there

centril (Dec 17 2018 at 19:30, on Zulip):

yeah; @tmandry I'm working on an RFC for for<T: Foo + 'a> +/- generic closures; that would also benefit from chalk

scalexm (Dec 17 2018 at 19:30, on Zulip):

@centril could you elaborate about where clauses on enum variants? I'm not sure to follow

scalexm (Dec 17 2018 at 19:30, on Zulip):

also I don't believe specialization needs a complete redesign, just stricter rules so that it is sound, which I believe @nikomatsakis have worked on a bit already

nikomatsakis (Dec 17 2018 at 19:31, on Zulip):

also, I suspect finishing chalkification should make it easier to iterate on a lot of things we're talking about

I believe this to be true, for sure

centril (Dec 17 2018 at 19:31, on Zulip):

@scalexm what I mean by "redesign" is a T-lang RFC to rework the accepted semantics; I'm interested in something along the lines Aaron set out

centril (Dec 17 2018 at 19:32, on Zulip):

particularly the surface syntax

nikomatsakis (Dec 17 2018 at 19:32, on Zulip):

I agree we need to write up a complete proposal with the new semantics

nikomatsakis (Dec 17 2018 at 19:32, on Zulip):

I'm not sure exactly what process I think is most appropriate, but an RFC seems potentially OK

scalexm (Dec 17 2018 at 19:32, on Zulip):

yeah; @tmandry I'm working on an RFC for for<T: Foo + 'a> +/- generic closures; that would also benefit from chalk

Indeed i believe this would be easier with chalk

nikomatsakis (Dec 17 2018 at 19:32, on Zulip):

hmm that reminds me

centril (Dec 17 2018 at 19:32, on Zulip):

@scalexm enum Expr<T> { Plus(Box<Expr<T>>, Box<Expr<T>>) where T: Add, Minus(Box<Expr<T>>, Box<Expr<T>>) where T: Sub, ... }

centril (Dec 17 2018 at 19:33, on Zulip):

GADTs without existentials, essentially

nikomatsakis (Dec 17 2018 at 19:33, on Zulip):

there are some soundness holes (most notably #25860) I've been expecting to close once chalk is in place

scalexm (Dec 17 2018 at 19:33, on Zulip):

we may even ben able to model it in the chalk repo already

nikomatsakis (Dec 17 2018 at 19:34, on Zulip):

@centril what is "ConstraintKinds"?

centril (Dec 17 2018 at 19:34, on Zulip):

@nikomatsakis https://kseo.github.io/posts/2017-01-13-constraint-kinds.html

nikomatsakis (Dec 17 2018 at 19:34, on Zulip):

(this whole discussion also gets at something I'm wanting us to thikn about, which is how to reshape the lang team so that it is operating in a more decentralized fashion)

centril (Dec 17 2018 at 19:35, on Zulip):

i.e. foo<trait T> + associated traits

nikomatsakis (Dec 17 2018 at 19:35, on Zulip):

I don't really know that that is supposed to mean

nikomatsakis (Dec 17 2018 at 19:35, on Zulip):

I'm familiar with the term from haskell but kind of forgot the details

centril (Dec 17 2018 at 19:36, on Zulip):

@nikomatsakis it makes "trait" a kind that users can quantify; I haven't done any work on this in a while, but: https://github.com/Centril/rfc-trait-parametric-polymorphism/

nikomatsakis (Dec 17 2018 at 19:37, on Zulip):

I see, ok.

nikomatsakis (Dec 17 2018 at 19:37, on Zulip):

well, that all seems 100% blocked on chalk :)

centril (Dec 17 2018 at 19:37, on Zulip):

(iirc we discussed this before and you likened it to something in prolog...)

nikomatsakis (Dec 17 2018 at 19:37, on Zulip):

yes, I recall

centril (Dec 17 2018 at 19:37, on Zulip):

yeah; 100% ;)

nikomatsakis (Dec 17 2018 at 19:38, on Zulip):

(along these lines, I am thinking about the process for "ratifying" the lowering from traits to logic -- I don't know that an RFC is necessarily the right thing, but it feels like it is "cementing" part of Rust's semantics that have heretofore been unspecified, and it would be nic to make it "official" once we feel good about it)

nikomatsakis (Dec 17 2018 at 19:39, on Zulip):

though I think there remain some interesting questions -- e.g., I continue to feel like there is probably a higher-level logic that could be used as an intermediate step

nikomatsakis (Dec 17 2018 at 19:39, on Zulip):

anyway

centril (Dec 17 2018 at 19:39, on Zulip):

(depends on how detailed you want to be; a formal specification for traits/operational-semantics/other-stuff in Agda/Coq/Lean/F*/insert-random-theorem-prover would be nice for high-detail stuff)

tmandry (Dec 17 2018 at 19:41, on Zulip):

So, chalkification:
- unblocks oft-requested features
- unblocks or speeds up experimentation on new ones
- pays down technical debt
- potentially speeds up compiler a lot
it's pretty clear to me this should be a priority :)

nikomatsakis (Dec 17 2018 at 19:41, on Zulip):

I'm curious whether people see things as missing from this list

nikomatsakis (Dec 17 2018 at 19:42, on Zulip):

@Alexander Regueiro in particular I would like you to take a look :point_up:

tmandry (Dec 17 2018 at 19:42, on Zulip):

perhaps a preemptible one, for shipping larger rust-wide pushes such as async.. I personally can see the value in getting that really polished

centril (Dec 17 2018 at 19:43, on Zulip):

@nikomatsakis I thought type Foo = impl Trait; wasn't blocked on chalk?

nikomatsakis (Dec 17 2018 at 19:43, on Zulip):

yeah, probably. I am still feeling pretty good about pushing harder on chalk for time being, but I'd like to feel like we have a kind of roadmap of how to proceed, and make sure we're not just rushing in

nikomatsakis (Dec 17 2018 at 19:43, on Zulip):

I thought type Foo = impl Trait; wasn't blocked on chalk?

did I say otherwise?

nikomatsakis (Dec 17 2018 at 19:44, on Zulip):

I do think there is some work in chalk probably needed here, since impl Trait isn't really suported or modeled by chalk right now

tmandry (Dec 17 2018 at 19:44, on Zulip):

nods

nikomatsakis (Dec 17 2018 at 19:44, on Zulip):

this is not a list of "things blocked on chalk"

nikomatsakis (Dec 17 2018 at 19:44, on Zulip):

it's a list of "things we want to do"

centril (Dec 17 2018 at 19:44, on Zulip):

@nikomatsakis I assumed "trait system area" meant chalk :P

centril (Dec 17 2018 at 19:44, on Zulip):

oh :P

centril (Dec 17 2018 at 19:44, on Zulip):

yeah it makes more sense now

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

ok, well, before we go, a question of scheduling:

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

the next meeting is Dec 24

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

let's cancel that right now :)

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

the meeting after that is Dec 31

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

I'm thinking maybe cancel that too, and reconvene in Jan?

nikomatsakis (Dec 17 2018 at 19:46, on Zulip):

I may or may not be working, I don't know

tmandry (Dec 17 2018 at 19:47, on Zulip):

makes sense I think

tmandry (Dec 17 2018 at 19:47, on Zulip):

we can sync up here on work as needed

nikomatsakis (Dec 17 2018 at 19:47, on Zulip):

yeah that's what i'm thinking

tmandry (Dec 17 2018 at 19:48, on Zulip):

going to try to get some guide work done this week

nikomatsakis (Dec 17 2018 at 19:49, on Zulip):

cool

tmandry (Dec 17 2018 at 19:49, on Zulip):

this doc is a good example of what a traits-wg repo would look like, I guess

tmandry (Dec 17 2018 at 19:49, on Zulip):

?

tmandry (Dec 17 2018 at 19:49, on Zulip):

each bullet point is an issue

nikomatsakis (Dec 17 2018 at 19:49, on Zulip):

I imagine it would have a kind of "master roadmap" sort of like that

nikomatsakis (Dec 17 2018 at 19:49, on Zulip):

plus in-progress rfcs

nikomatsakis (Dec 17 2018 at 19:49, on Zulip):

where appropriate

nikomatsakis (Dec 17 2018 at 19:50, on Zulip):

maybe using issues, maybe not

nikomatsakis (Dec 17 2018 at 19:51, on Zulip):

I'm not sure it's a good place what's the best way to manage discussion, but I feel like collecting things together might be useful

nikomatsakis (Dec 17 2018 at 19:51, on Zulip):

still trying to figure it out to be honest

centril (Dec 17 2018 at 19:51, on Zulip):

@nikomatsakis added some notes to the hackmd doc

nikomatsakis (Dec 17 2018 at 19:52, on Zulip):

I saw, thanks!

nikomatsakis (Dec 17 2018 at 19:52, on Zulip):

ok, let's reconvene Jan 7 then

tmandry (Dec 17 2018 at 19:52, on Zulip):

I think issues are better at getting updated than docs.. would be interesting to try putting "higher level tracking issues" here..?

tmandry (Dec 17 2018 at 19:52, on Zulip):

oops just saw the rest of this

centril (Dec 17 2018 at 19:53, on Zulip):

I'll see if I can start working on some non-trait related work in the compiler to learn my way to traits eventually :P

centril (Dec 17 2018 at 19:53, on Zulip):

so I can implement my own RFCs, lol =P

centril (Dec 17 2018 at 19:57, on Zulip):

(added some more notes again)

Alexander Regueiro (Dec 17 2018 at 20:18, on Zulip):

@nikomatsakis would appreciate some advice on what to do about that future compat warning for my trait aliases PR btw... I think that should become a regular lint, but we should leave a future compat warning in place for the coherence case? I'm not sure how to do it for coherence though, sounds kind of difficult.

ok ye I can do that today

thanks :-)

Alexander Regueiro (Dec 17 2018 at 20:19, on Zulip):

@centril yeah. wait until Chalk integration has completed anyway, since if you started now, you'd be relearning a lot.

Alexander Regueiro (Dec 17 2018 at 20:24, on Zulip):

@nikomatsakis okay, I looked at the document... 1) the trait objects point (upcasting & multi-trait) should probably move to the second section, since there's no RFC yet. though it's possible dhardy or I will try an experimental implementation before/while the RFC is being written. 2) for<T: Debug> -- this is HRTB yes? probably worth saying so.

Alexander Regueiro (Dec 17 2018 at 20:24, on Zulip):

I can't edit unfortunately.

nikomatsakis (Dec 17 2018 at 20:25, on Zulip):

I'm not that worried about whether an RFC exists, so much as the amount of "end-user design" that seems like it may be needed

Alexander Regueiro (Dec 17 2018 at 20:25, on Zulip):

err... yes, I can. turns out I just don't know how to use HackMD

nikomatsakis (Dec 17 2018 at 20:25, on Zulip):

(but feel free to move around)

Alexander Regueiro (Dec 17 2018 at 20:27, on Zulip):

anyway, list looks good

Last update: Nov 18 2019 at 00:40UTC