Stream: t-lang

Topic: design meetings during April


nikomatsakis (Apr 02 2020 at 21:32, on Zulip):

So hey @T-lang, let's talk about design meetings! We've got a list of potential topics for April in the paper, which is currently

nikomatsakis (Apr 02 2020 at 21:32, on Zulip):

I think I might add a few more such as

centril (Apr 02 2020 at 21:32, on Zulip):

cc @eddyb on type aliases & bounds

nikomatsakis (Apr 02 2020 at 21:32, on Zulip):
Josh Triplett (Apr 02 2020 at 21:33, on Zulip):

@nikomatsakis I would love to have the "copy out of references" discussion, and better understand the use cases there. Can I suggest that we schedule that one at a time that would allow enough prep time for folks who want a change there to supply some use cases or examples without feeling rushed?

nikomatsakis (Apr 02 2020 at 21:33, on Zulip):
Josh Triplett (Apr 02 2020 at 21:34, on Zulip):

I feel like UCG is sufficiently amorphous that the only discrete topic I can think of there is "what discrete topics are separable and able to be evaluated"?

centril (Apr 02 2020 at 21:35, on Zulip):

@nikomatsakis @eddyb handed me: https://github.com/rust-lang/rust/pulls?q=is%3Aclosed+is%3Apr+author%3Aeddyb+is%3Aunmerged+type+alias+

Josh Triplett (Apr 02 2020 at 21:35, on Zulip):

@nikomatsakis Also CC @Taylor Cramer on the try family of items. And for that one, I would be happy to come prepared to discuss and evaluate alternatives there, and I've found myself increasingly open to changing my mind. I no longer have the objection I once did to try blocks, and my only point of contention is "what type do they have and how do we write that type", which I feel like is a narrower point conducive to collaborative solution-finding.

centril (Apr 02 2020 at 21:35, on Zulip):

All the type alias PRs are in those search results

Josh Triplett (Apr 02 2020 at 21:37, on Zulip):

(Also, let me say that more strongly: I have found lately that I've actively wanted try blocks several times, so it's not just that I'm now neutral to them.)

Josh Triplett (Apr 02 2020 at 21:37, on Zulip):

/me opens a separate thread for a related tangent.

eddyb (Apr 02 2020 at 21:38, on Zulip):

note that https://github.com/rust-lang/rust/issues/49441#issuecomment-421136550 is the issue we were using to track the 2018 stuff before it fell through the floor

eddyb (Apr 02 2020 at 21:39, on Zulip):

2018 burnout was real :(

nikomatsakis (Apr 02 2020 at 21:40, on Zulip):

Sorry, I'm a bit afk actually, having kind of started this discussion off :)

nikomatsakis (Apr 02 2020 at 21:40, on Zulip):

Didn't realize how late it was

nikomatsakis (Apr 02 2020 at 21:40, on Zulip):

In terms of available dates in April, we have

nikomatsakis (Apr 02 2020 at 21:41, on Zulip):

(Excluding next week)

pnkfelix (Apr 03 2020 at 16:21, on Zulip):

I'm guessing edition planning should be handled at some point during this design cycle

pnkfelix (Apr 03 2020 at 16:21, on Zulip):

given that its already April

pnkfelix (Apr 03 2020 at 16:21, on Zulip):

but I don't think it will matter much if we do it in mid April or at end of April

centril (Apr 03 2020 at 16:30, on Zulip):

I would suggest 20th for the edition stuff, and 27th for the type alias stuff (since it ties into the edition)

nikomatsakis (Apr 08 2020 at 21:08, on Zulip):

@Josh Triplett so see the available dates above

nikomatsakis (Apr 08 2020 at 21:10, on Zulip):

I think discussing try seems good

nikomatsakis (Apr 08 2020 at 21:10, on Zulip):

but there are a few different aspects to it

nikomatsakis (Apr 08 2020 at 21:10, on Zulip):

I wonder if we can fit it all in one meeting?

nikomatsakis (Apr 08 2020 at 21:11, on Zulip):

I'm thinking of:

nikomatsakis (Apr 08 2020 at 21:11, on Zulip):
nikomatsakis (Apr 08 2020 at 21:11, on Zulip):
nikomatsakis (Apr 08 2020 at 21:12, on Zulip):
nikomatsakis (Apr 08 2020 at 21:12, on Zulip):

I've not read @boats's posts, but obviously i'd like for them to be present

nikomatsakis (Apr 08 2020 at 21:13, on Zulip):

though not necessarily for the first point

nikomatsakis (Apr 08 2020 at 21:15, on Zulip):

Hmm, I think doing

nikomatsakis (Apr 08 2020 at 21:15, on Zulip):

(On mondays)

nikomatsakis (Apr 08 2020 at 21:15, on Zulip):

seems reasonable

nikomatsakis (Apr 08 2020 at 21:15, on Zulip):

I would be happy to try and lead up the Edition a bit

nikomatsakis (Apr 08 2020 at 21:16, on Zulip):

I would also be ok with putting off the type alias slightly further, if we think that's too many meetings and we won't be able to manage it

eddyb (Apr 08 2020 at 21:16, on Zulip):

it's fine I think

nikomatsakis (Apr 08 2020 at 21:16, on Zulip):

i.e., we could do it first thing in may

Josh Triplett (Apr 08 2020 at 21:16, on Zulip):

I would suggest that if we order it correctly, we could get through as much as we can in one meeting:
1) try blocks and Ok-wrapping, for which as far as I an tell there aren't any remaining disagreements.
2) Try trait: what do we need to complete in order to stabilize try blocks? This is more complicated, but not necessarily a source of massive disagreements, just technical difficulties.
3) try functions and potential syntax there; this is likely to expand to encompass -> Result<T, E> versus syntax proposals that hide Result, so let's put it last and if we run out of time that's OK.

nikomatsakis (Apr 08 2020 at 21:16, on Zulip):

This sounds reasonable

nikomatsakis (Apr 08 2020 at 21:17, on Zulip):

What do you think of that overall schedule? Also, can we discuss how the Edition planning might work

Josh Triplett (Apr 08 2020 at 21:17, on Zulip):

I'm also wondering if there'd be any objection to starting on (1) and getting the skeleton of what needs to be solved for (2) in Thursday's meeting?

nikomatsakis (Apr 08 2020 at 21:17, on Zulip):

are you referring to try blocks?

nikomatsakis (Apr 08 2020 at 21:18, on Zulip):

I thkn that try blocks ok wrap now

nikomatsakis (Apr 08 2020 at 21:18, on Zulip):

so I don't think there's any real "work" to be done there

Josh Triplett (Apr 08 2020 at 21:18, on Zulip):

Yes. Because if we end up resolving (1) in Thursday's meeting, and getting a skeleton for (2), then the design meeting on Monday could be much simpler.

nikomatsakis (Apr 08 2020 at 21:18, on Zulip):

if we want to reach a decision, I could imagine that we create an issue with a summary of some of the pros/cons and do an fcp

Josh Triplett (Apr 08 2020 at 21:18, on Zulip):

@nikomatsakis The "work" is effectively an explicit "are there any remaining objections, or any other blockers for try block stabilization other than the Try trait".

nikomatsakis (Apr 08 2020 at 21:18, on Zulip):

to make it official

nikomatsakis (Apr 08 2020 at 21:18, on Zulip):

and I think we could just do that today

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

the problem is that I don't know that thu meeting necessary has all the folks presnt in it?

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

but I guess it has enough

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

that's also fine

Josh Triplett (Apr 08 2020 at 21:19, on Zulip):

An FCP on an appropriate issue sounds good, sure. I wasn't sure which issue it should occur on. ;)

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

I'd make a dedicated issue personally, and link to it

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

I prefer to have an issue per decision

nikomatsakis (Apr 08 2020 at 21:19, on Zulip):

link to it from https://github.com/rust-lang/rust/issues/31436 I mean, I guess

Josh Triplett (Apr 08 2020 at 21:19, on Zulip):

Thinking about the overall schedule...

Josh Triplett (Apr 08 2020 at 21:20, on Zulip):

type alias as in impl Trait?

nikomatsakis (Apr 08 2020 at 21:20, on Zulip):

no

nikomatsakis (Apr 08 2020 at 21:21, on Zulip):

that is referring to the long-standing issue that type Foo<T: Trait> = ... doesn't enforce T: Trait

Josh Triplett (Apr 08 2020 at 21:21, on Zulip):

Oh!

nikomatsakis (Apr 08 2020 at 21:21, on Zulip):

the topic has been coming up again because of a recent PR to enforce "well-formedness conditions" in some cases

nikomatsakis (Apr 08 2020 at 21:21, on Zulip):

we deferred it for Rust 2018

eddyb (Apr 08 2020 at 21:21, on Zulip):

which we almost fixed back for Rust 2018

nikomatsakis (Apr 08 2020 at 21:21, on Zulip):

if we want to address it again, we thought we would review what happened last time

eddyb (Apr 08 2020 at 21:21, on Zulip):

but gestures vaguely stuff happened

nikomatsakis (Apr 08 2020 at 21:21, on Zulip):

and talk about some of the options

Josh Triplett (Apr 08 2020 at 21:21, on Zulip):

Is this also related to not being able to assume <T: Trait> in the impl SomeType block of a type, even if the data type implies that T: Trait?

eddyb (Apr 08 2020 at 21:22, on Zulip):

I don't think so

nikomatsakis (Apr 08 2020 at 21:22, on Zulip):

I think you're referring to implied bounds

nikomatsakis (Apr 08 2020 at 21:22, on Zulip):

there actually is a relationship

nikomatsakis (Apr 08 2020 at 21:22, on Zulip):

but it's not .. direct?

eddyb (Apr 08 2020 at 21:22, on Zulip):

this is about type Foo = ...; not type-checking ... at all at the definition site

Josh Triplett (Apr 08 2020 at 21:22, on Zulip):

nikomatsakis said:

I think you're referring to implied bounds

I think you're right, yeah.

eddyb (Apr 08 2020 at 21:23, on Zulip):

and also use sites don't see the bounds at all, just the ... part (the "RHS")

nikomatsakis (Apr 08 2020 at 21:23, on Zulip):

There is a relationship in that one way to "rationalize" today's behavior is to imagine that there's an implied where clause that says the RHS if well-formed, which is a kind of "implied bound".

nikomatsakis (Apr 08 2020 at 21:24, on Zulip):

but it's not a "real relationship"

eddyb (Apr 08 2020 at 21:24, on Zulip):

anyway @nikomatsakis can handle this, ping me if you have any questions for me specifically (trying not to multitask too much :P)

nikomatsakis (Apr 08 2020 at 21:24, on Zulip):

( another relationship is that continued progress around chalk is related )

Josh Triplett (Apr 08 2020 at 21:24, on Zulip):

Alright. So, that seems like a reasonable thing to put on the agenda, and I'll be interested to listen and hear many things about traits and types and inference that I likely don't know. :)

nikomatsakis (Apr 08 2020 at 21:24, on Zulip):

it seems good to revisit it

Josh Triplett (Apr 08 2020 at 21:24, on Zulip):

So, the three proposals sound good to me.

nikomatsakis (Apr 08 2020 at 21:24, on Zulip):

but let's talk a bit about the edition meeting

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

what's needed to make that productive

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

what I have in mind is

Josh Triplett (Apr 08 2020 at 21:25, on Zulip):

We should make a document of "things we might want to change in an edition", and give people plenty of time to contribute to it before a meeting, I think...

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

(1) go back over 'ergonomic initiative' and other stuff that didn't make it for Rust 2018 (which includes the type alias stuff) and try to write out some of the potential edition implications

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

yes

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

I am basically imagining creating such a doc and starting to fill it out

nikomatsakis (Apr 08 2020 at 21:25, on Zulip):

and trying to do that early

Josh Triplett (Apr 08 2020 at 21:26, on Zulip):

That sounds good to me.

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

I think we should also include things like "change of defaults"

Josh Triplett (Apr 08 2020 at 21:26, on Zulip):

I'm going to take a few minutes and write up a dedicated issue for try block Ok-wrapping.

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

i.e., I would include the "unsafe ops in unsafe fns"

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

(we had some discussion of whether we might switch the default there)

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

I think it'd be good to have a master list that we can revisit and keep an eye on

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

and use to drive our efforts

nikomatsakis (Apr 08 2020 at 21:26, on Zulip):

so our goal should be to produce that, and we should start the list now

nikomatsakis (Apr 08 2020 at 21:27, on Zulip):

that is, while you do that, I will create a paper document and start adding stuff

Josh Triplett (Apr 08 2020 at 21:27, on Zulip):

We should also include, in the list, things we don't plan to do but that someone might expect. For instance, someone on internals recently suggested killing ref and ref mut in an edition, which, let's not. ;)

nikomatsakis (Apr 08 2020 at 21:27, on Zulip):

heh. Yeah, I'm ok waiting on that (although I don't find I use them anymore)

Josh Triplett (Apr 08 2020 at 21:27, on Zulip):

I'd like to err on the side of completeness, rather than prioritizing the list of "things we want to do" over "things we don't want to do".

nikomatsakis (Apr 08 2020 at 21:27, on Zulip):

btw

nikomatsakis (Apr 08 2020 at 21:28, on Zulip):

I just happened to click on that internals thread and see your post

nikomatsakis (Apr 08 2020 at 21:28, on Zulip):

that issue around &u32 is definitely one of the key motivators for the &T -> T coercions where T: Copy

nikomatsakis (Apr 08 2020 at 21:28, on Zulip):

but I guess you know that :)

Josh Triplett (Apr 08 2020 at 21:28, on Zulip):

nikomatsakis said:

I just happened to click on that internals thread and see your post

I find myself wishing I could have written the example that I did back when we were debating this.

nikomatsakis (Apr 08 2020 at 21:28, on Zulip):

that issue was extensively discussed, fwiw

nikomatsakis (Apr 08 2020 at 21:29, on Zulip):

but maybe not extensively enough :)

Josh Triplett (Apr 08 2020 at 21:29, on Zulip):

I remember, vividly. I just don't remember any examples coming up that demonstrated, on a practical level, the "rustc can't help me find the root error anymore" problem.

nikomatsakis (Apr 08 2020 at 21:29, on Zulip):

Yeah, I mean, I think we just didn't do the follow-up

nikomatsakis (Apr 08 2020 at 21:29, on Zulip):

All the more reason to do it now!

Josh Triplett (Apr 08 2020 at 21:30, on Zulip):

nod

nikomatsakis (Apr 08 2020 at 21:30, on Zulip):

I guess I disagree with your assertion that suggesting *x is wrong

nikomatsakis (Apr 08 2020 at 21:30, on Zulip):

but let's not get too far off topic

nikomatsakis (Apr 08 2020 at 21:30, on Zulip):

(in particular, the edit I make in practice is adding a *x)

Josh Triplett (Apr 08 2020 at 21:30, on Zulip):

nikomatsakis said:

that issue around &u32 is definitely one of the key motivators for the &T -> T coercions where T: Copy

Thank you for pointing that out; that helps me understand a bit better. Needs some further thought.

nikomatsakis (Apr 08 2020 at 21:30, on Zulip):

(not that I'm super happy about that)

nikomatsakis (Apr 08 2020 at 21:31, on Zulip):

that's on our list, but I think we can discuss those things post April

Josh Triplett (Apr 08 2020 at 21:31, on Zulip):

I would love to talk with you and introspect a bit on your feeling of "not that I'm super happy about that", to understand why that's the fix you tend to make in practice even if you don't want to.

nikomatsakis (Apr 08 2020 at 21:32, on Zulip):

yes, I'd enjoy that

nikomatsakis (Apr 08 2020 at 21:32, on Zulip):

oops dang it

nikomatsakis (Apr 08 2020 at 21:32, on Zulip):

I had a draft of the final schedule

Josh Triplett (Apr 08 2020 at 21:32, on Zulip):

And yes, this is getting a little off-topic. ;)
The slightly more comedic version I considered, when trying to explain my reaction to rustc's errors:
"Your foundation is broken. Would you like to add a flying buttress?" No, rustc, I'd like to fix the foundation, not patch around the original error by propping up the wobbly result the other way.

nikomatsakis (Apr 08 2020 at 21:32, on Zulip):

and I stupidly did select-all delete and lost it

nikomatsakis (Apr 08 2020 at 21:32, on Zulip):

let me rewrite it :)

eddyb (Apr 08 2020 at 21:36, on Zulip):

nikomatsakis said:

(in particular, the edit I make in practice is adding a *x)

I almost always try to add & to a pattern before I find it prettier than * (and for more than 1 use, it's less noise since only the pattern needs to change, not the uses)

Josh Triplett (Apr 08 2020 at 21:37, on Zulip):

@eddyb Agreed. Though adding * to the match scrutinee can avoid the need to add & to a half-dozen patterns; for some reason I don't tend to find that intuitive to reach for, though.

eddyb (Apr 08 2020 at 21:37, on Zulip):

I mean |&x| x instead of |x| *x, where the * would be later than the &

Josh Triplett (Apr 08 2020 at 21:37, on Zulip):

I think I have some kind of incorrect associations regarding match *x, such that it "feels" like that's going to surprise me by making a copy I don't expect.

Josh Triplett (Apr 08 2020 at 21:38, on Zulip):

@eddyb (I know, and that's what niko meant too. I was referring to a third possibility there.)

nikomatsakis (Apr 08 2020 at 21:38, on Zulip):

@Josh Triplett how does this gist look to you?

Amanieu (Apr 08 2020 at 21:39, on Zulip):

Does asm! need a design meeting to move forward? Or is it blocked on something else?

nikomatsakis (Apr 08 2020 at 21:39, on Zulip):

I don't believe it does.

nikomatsakis (Apr 08 2020 at 21:39, on Zulip):

Well, let me revisit that

Josh Triplett (Apr 08 2020 at 21:40, on Zulip):

@nikomatsakis Minor request: could you change "try functions" to "function-level try"? I feel like the former predisposes us towards try fn, while the latter feels more syntax-agnostic to me as a description.

nikomatsakis (Apr 08 2020 at 21:40, on Zulip):

@Amanieu so here is why I am revisiting that

nikomatsakis (Apr 08 2020 at 21:40, on Zulip):

in general, I think it'd be super healthy for us

nikomatsakis (Apr 08 2020 at 21:40, on Zulip):

if when we are introducing a major new piece of design

nikomatsakis (Apr 08 2020 at 21:40, on Zulip):

we spend a design meeting on it

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

to have somebody kind of walk over the RFC and lay out what it does

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

even if we've all already read it

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

and kind of know

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

it produces a video that we can publish

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

I also question whether it's ever really true that everybody has had time to catch up

Josh Triplett (Apr 08 2020 at 21:41, on Zulip):

(We did actually spend a big piece of a lang meeting on asm!, by the way, when it first came up.)

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

well, we did, but that's different

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

also, I don't know that we really did

Josh Triplett (Apr 08 2020 at 21:41, on Zulip):

I'm not arguing that we shouldn't spend another. ;)

nikomatsakis (Apr 08 2020 at 21:41, on Zulip):

in particular, the final RFC didn't exist

nikomatsakis (Apr 08 2020 at 21:42, on Zulip):

we talked about whether to do asm!, but not so much about the actual proposal, and the discussion that arose during the course of it, and so forth

nikomatsakis (Apr 08 2020 at 21:42, on Zulip):

all of that said, I'm not sure it's the best use of time this month

Josh Triplett (Apr 08 2020 at 21:42, on Zulip):

Ah, I see. You're suggesting that in general we should spend a meeting reviewing the details of a (seemingly) completed RFC?

nikomatsakis (Apr 08 2020 at 21:42, on Zulip):

I just think in general it'd be cool to be doing more presentations like that

nikomatsakis (Apr 08 2020 at 21:42, on Zulip):

I kind of think so, yes

Josh Triplett (Apr 08 2020 at 21:43, on Zulip):

I think that's a good idea, especially if we manage to move more to the "approve delegating this" and later "approve the result of the delegated team" model.

nikomatsakis (Apr 08 2020 at 21:43, on Zulip):

or at least I think it's a healthy thing to do

nikomatsakis (Apr 08 2020 at 21:43, on Zulip):

I don't think I'd say it should be "required"

nikomatsakis (Apr 08 2020 at 21:43, on Zulip):

exactly

nikomatsakis (Apr 08 2020 at 21:43, on Zulip):

(it depends, I think, on the scope of the RFC etc)

Josh Triplett (Apr 08 2020 at 21:44, on Zulip):

Schedule looks good to me other than that one nit.

Amanieu (Apr 08 2020 at 21:45, on Zulip):

There's also the distinction between replacing asm! in nightly and stabilizing it. How much should the former be blocked on lang team approval (which is definitely needed for the latter).

nikomatsakis (Apr 08 2020 at 21:50, on Zulip):

so we discussed this just a bit in privmsg but to bring it here

nikomatsakis (Apr 08 2020 at 21:50, on Zulip):

that's actually a more interesting question than I thought at first :P

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

I think in my ideal world we would tilt ourselves towards permitting stuff to land before a design is "ready"

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

this was the idea of creating project groups

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

that we clear up the "intent to explore this" first

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

and then people can land etc etc

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

and the RFC could indeed come after the impl is done

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

and it is just laying out the design that we wound up with

nikomatsakis (Apr 08 2020 at 21:51, on Zulip):

(ideally, they co-evolve, as I think happened here)

nikomatsakis (Apr 08 2020 at 21:52, on Zulip):

so I think in this case what we really need is to resolve https://github.com/rust-lang/rfcs/pull/2836, and I don't think a design meeting is the best venue for that ultimately

nikomatsakis (Apr 08 2020 at 21:54, on Zulip):

@Josh Triplett how is this :)

April 13 -- Try blocks, try traits, functions that try, oh my!

nikomatsakis (Apr 08 2020 at 21:54, on Zulip):

I like my whimsical rhyme ;)

boats (Apr 08 2020 at 22:02, on Zulip):

i can attend any week

Josh Triplett (Apr 08 2020 at 22:10, on Zulip):

@nikomatsakis I just realized something else that needs adding to the try design meeting, which I'd suggest covering after the Try trait and before functions that try: the error return mechanism from try blocks and functions that try. fail err;, throw err;, raise err;, Err(err)?;...

Josh Triplett (Apr 08 2020 at 22:11, on Zulip):

Still likely to lead to syntax disputes, but less so than the syntax for functions that try.

scottmcm (Apr 09 2020 at 06:26, on Zulip):

nikomatsakis said:

I can make the 13th. Anything particular you'd like I prepare for it?

centril (Apr 09 2020 at 06:26, on Zulip):

Josh Triplett said:

We should also include, in the list, things we don't plan to do but that someone might expect. For instance, someone on internals recently suggested killing ref and ref mut in an edition, which, let's not. ;)

I think that's a great idea to avoid the free-for-all; and I'm in full agreement re. "let's not" for ref mut?

centril (Apr 09 2020 at 06:31, on Zulip):

Josh Triplett said:

nikomatsakis I just realized something else that needs adding to the try design meeting, which I'd suggest covering after the Try trait and before functions that try: the error return mechanism from try blocks and functions that try. fail err;, throw err;, raise err;, Err(err)?;...

This also ties into the edition as we have to use that mechanism for any keyword; throw err; seems more unlikely now that more macros named throw!(err); exist, so fail err; seems more plausible now I think.

scottmcm (Apr 09 2020 at 06:38, on Zulip):

I think that what we might want to do with throw comes into the trait discussions as well. Both in the obvious way that we need to desugar it to something, but also in that if one of the Try rewrite goals is that it "remembers" result- or option-ness from a ? then we'd need to figure out how to colour a throw properly.

Josh Triplett (Apr 09 2020 at 06:48, on Zulip):

In a function that returns an Option, I would think we'd just want fail; with no arguments.

scottmcm (Apr 09 2020 at 06:58, on Zulip):

Hmm, interesting. I agree, but I also think that bikeshed; and bikeshed (); so the same thing here, as they do with return and break. And I think those two statements contradict each other

Josh Triplett (Apr 09 2020 at 06:59, on Zulip):

That would probably depend on how it desugars.

scottmcm (Apr 09 2020 at 07:41, on Zulip):

Unbaked idea that I wanted to write down because I'm forgetful: right now the error-conversion we do for results is part of the ? desugar. But AFAICT that's currently indistinguishable from it happening at function-level, since there can only be one "level" of ?s in a function. So if we wanted to we could potentially _not_ to the error-conversion inside try, to reduce the type annotation requirements. (For the whole "I'd like to not have to annotate try { a? + b? } and have it just use the same carrier and error type" conversation.) Though I suppose that has the obvious downside that IIFEs and try{}s would do different things, so maybe it's bad.

centril (Apr 09 2020 at 07:43, on Zulip):

@scottmcm Seems like a good idea to move the From::from part of lowering into something specific to Result<_, _> if possible so that users can have a choice about that conversion for their own types

centril (Apr 09 2020 at 07:44, on Zulip):

Except that's not what you're saying :slight_smile:

centril (Apr 09 2020 at 07:44, on Zulip):

/me is tired...

scottmcm (Apr 09 2020 at 07:45, on Zulip):

It's still a good idea :P And fits well in the trait split I think we're heading towards

centril (Apr 09 2020 at 07:47, on Zulip):

Also, @comex's point regarding perf seems like something we should keep in mind and avoid making MIR optimizations have too much of a hard time with ?

scottmcm (Apr 09 2020 at 07:51, on Zulip):

My current thought is that we should have a TryBlock trait with an associated type for the continue-normally path, because that gives us the "you get a predictable type from x?" and "you can flow type information backwards into a try{ Default::default() }" things that are why we picked the current Try design. But that for the splitting-and-error-handling stuff we should use a separate trait -- like the one in the original Try RFC design -- to allow the implementation to choose with which types it's willing to interoperate.

nikomatsakis (Apr 10 2020 at 21:55, on Zulip):

Update: given that there's been a lot of discussion around try, we opted to push the meeting back a bit to let things and opinions settle down. For now the "try meeting" is tentatively scheduled for May 4, but we can revisit as we think about meetings for May later on. :heart:

Last update: Jun 05 2020 at 21:30UTC