Stream: t-compiler/wg-rls-2.0

Topic: Status/Planning meeting


matklad (May 07 2019 at 11:43, on Zulip):

Hey, @WG-rls2.0, do we think we need a high-level planing meeting/sync-up soon? We haven't had one for a while, but at the same time the progress is steady and impressive, so I don't think like we need planing. Though, we may sort-of celebrate what we've achieved since all-hands.

nikomatsakis (May 07 2019 at 13:39, on Zulip):

I at least would love to hear updates!

Florian Diebold (May 08 2019 at 12:57, on Zulip):

ok, I'd be up for it

matklad (May 08 2019 at 13:17, on Zulip):

Let's do this: https://doodle.com/poll/5a74s37gvxnp23k3!

I suggest spending the first half discussing what we've already done, and the second half for high-level planning.

They key people are @Florian Diebold and @Edwin Cheng , but of course the more the merrier! cc @WG-rls2.0

pnkfelix (May 08 2019 at 14:05, on Zulip):

I’m pretty ill (bedridden) so I can’t guarantee I’ll make it to a mtg Friday. But I will try

Edwin Cheng (May 08 2019 at 14:12, on Zulip):

Sorry i am on vacation this week, but will be available next week all days.

Edwin Cheng (May 08 2019 at 14:24, on Zulip):

@pnkfelix take care!

matklad (May 09 2019 at 18:35, on Zulip):

@pnkfelix take care!

I've scheduled the meeting on Tuesday, invites sent!

matklad (May 14 2019 at 16:00, on Zulip):

@WG-rls2.0 : :bell: meeting time! :bell: :tada:

matklad (May 14 2019 at 16:00, on Zulip):

:wave:

Edwin Cheng (May 14 2019 at 16:01, on Zulip):

:wave:

Florian Diebold (May 14 2019 at 16:01, on Zulip):

Oh hm, I was under the impression it was in an hour... timezones :sweat_smile:

matklad (May 14 2019 at 16:02, on Zulip):

@nikomatsakis @pnkfelix @Igor Matuszewski, are you around?

nikomatsakis (May 14 2019 at 16:02, on Zulip):

i'm around -ish yeah

Igor Matuszewski (May 14 2019 at 16:02, on Zulip):

Same, although on a train atm

Igor Matuszewski (May 14 2019 at 16:03, on Zulip):

:wave:

matklad (May 14 2019 at 16:03, on Zulip):

Cool! Let's get started then?

matklad (May 14 2019 at 16:04, on Zulip):

We plan to start with short recap of progress

matklad (May 14 2019 at 16:04, on Zulip):

@Edwin Cheng would you like to start with talking a bit about macro by example?

matklad (May 14 2019 at 16:05, on Zulip):

(I assume @Florian Diebold would like some time to prep a chalk report :D )

Edwin Cheng (May 14 2019 at 16:05, on Zulip):

Okay, what i did in these weeks are just fixed all bugs from fooddogging :)

matklad (May 14 2019 at 16:06, on Zulip):

Does that mean that we just don't crash on rust-analyzer macros, or are we more or less correctly expanding stdlib now?

Edwin Cheng (May 14 2019 at 16:07, on Zulip):

It means latter, which means we should correctly (as i know) expanding stdlib now

matklad (May 14 2019 at 16:08, on Zulip):

:tada:

matklad (May 14 2019 at 16:08, on Zulip):

At least I can attest that we correctly expand syn's macro-generated AST

matklad (May 14 2019 at 16:08, on Zulip):

so, you now can hack on proc macros and get completion for syn types

Edwin Cheng (May 14 2019 at 16:09, on Zulip):

And as i know, we are only have one bug in rustc source code too.

nikomatsakis (May 14 2019 at 16:10, on Zulip):

that's really great

matklad (May 14 2019 at 16:10, on Zulip):

Should we move onto traits?

matklad (May 14 2019 at 16:11, on Zulip):

(Or I can tell a bit about the lexer stuff whihc I've been doing recently)

Florian Diebold (May 14 2019 at 16:11, on Zulip):

we can move onto traits ;)

matklad (May 14 2019 at 16:11, on Zulip):

Sure, go ahead! :)

Florian Diebold (May 14 2019 at 16:11, on Zulip):

Basically, we now use Chalk to check whether a type implements a trait for method resolution; we support where clauses now, so there's actual logic solving going on ;) There are a few missing minor details like super trait handling, and we keep running into cases where Chalk takes a very long time to solve a query (I think part of the reason we keep running into this is that we're missing so many features, so a lot of trait queries that should have a solution don't have one, which leads to Chalk trying out lots of combinations unsuccessfully.) So we're looking into adding a 'fuel' mechanism to Chalk that makes sure it never takes too long, even if that means we get a wrong answer (rust-lang/chalk#227, I'm hoping for your feedback @nikomatsakis )

Florian Diebold (May 14 2019 at 16:12, on Zulip):

but mainly right now I'm now looking at implementing support for Deref, because I think it's a good first step for associated type support (I don't need to implement assoc type resolution in paths for it), and it'll give a model for implementing for and ?

nikomatsakis (May 14 2019 at 16:13, on Zulip):

what exactly do you mean by "implementing support for Deref"?

matklad (May 14 2019 at 16:13, on Zulip):

Yeah, Deref + Try + Iterator would be awesome!

Florian Diebold (May 14 2019 at 16:13, on Zulip):

@nikomatsakis e.g. being able to provide autoderefed completions when you have an Arc<X>

Florian Diebold (May 14 2019 at 16:14, on Zulip):

so using the Deref::Target for * and autoderef

nikomatsakis (May 14 2019 at 16:15, on Zulip):

I see, ok

matklad (May 14 2019 at 16:16, on Zulip):

I suppose it's my turn now?

matklad (May 14 2019 at 16:16, on Zulip):

So, the kind-of big piece of work I was working on lately is librification of lexer

matklad (May 14 2019 at 16:17, on Zulip):

that is, I'd love to share lexer between rustc and rust-analzyer

matklad (May 14 2019 at 16:17, on Zulip):

Progress has been slow, but steady. Although the amount of code is small, extracting it from rustc is not trivial, and rebuilds are long :-(

matklad (May 14 2019 at 16:18, on Zulip):

That said, we already share code which handles escape sequences in string literals

matklad (May 14 2019 at 16:18, on Zulip):

so, rust-analyzer and rustc give you approximatelly the same error for "\u{FFFFFFF}"

matklad (May 14 2019 at 16:19, on Zulip):

and, I hope that after a next couple of refactrings on rustc side we share the lexer itself as well

matklad (May 14 2019 at 16:20, on Zulip):

I've also been doing various smaller things, and one interesting bit is the structured editing API

matklad (May 14 2019 at 16:20, on Zulip):

Our syntax tree is immutable, and that makes it hard to write refactorings that modify the source code

matklad (May 14 2019 at 16:21, on Zulip):

But now we have and API to do something like struct_literal.add_field(new_field), which handles trailing comma gracefully

matklad (May 14 2019 at 16:21, on Zulip):

And I think these are all the major things that happend recently

matklad (May 14 2019 at 16:22, on Zulip):

Note that name resolution librarification is stalled at the moment, mainly because nobody is working on it :D

nikomatsakis (May 14 2019 at 16:22, on Zulip):

But now we have and API to do something like struct_literal.add_field(new_field), which handles trailing comma gracefully

is this copy-on-write?

matklad (May 14 2019 at 16:22, on Zulip):

is this copy-on-write?

Yeah

matklad (May 14 2019 at 16:23, on Zulip):

So, it's like the API you've described in the blog post about immutale data structures in Rust

matklad (May 14 2019 at 16:23, on Zulip):

Except for the fact that we can't have &mut SyntaxNode because of the parent links

matklad (May 14 2019 at 16:24, on Zulip):

So you actually interract with &mut AstEditor<StructLiteral>

matklad (May 14 2019 at 16:25, on Zulip):

And... Lets move to planning?

matklad (May 14 2019 at 16:28, on Zulip):

So I think the recent macro and chalked work clarified some of the known unknowns about rust IDE

matklad (May 14 2019 at 16:28, on Zulip):

It seems like it is possible to expand macro, and it is possible to resolve traits during completion (although I too look forward to the fuel thing)

Florian Diebold (May 14 2019 at 16:29, on Zulip):

I'm actually really interested in trying to complete methods from traits that are not in scope as well

matklad (May 14 2019 at 16:29, on Zulip):

With auto-import?

Florian Diebold (May 14 2019 at 16:29, on Zulip):

yeah

matklad (May 14 2019 at 16:30, on Zulip):

Yeah, that's an interesting topic, which will require some IDE-specific machinery (index of visible stuff)

Florian Diebold (May 14 2019 at 16:30, on Zulip):

that'll be a lot more trait queries though

nikomatsakis (May 14 2019 at 16:31, on Zulip):

So I think the recent macro and chalked work clarified some of the known unknowns about rust IDE

can you drill in a bit here? by this you mean: we have clear challenges to try and tackle, at least in part

matklad (May 14 2019 at 16:31, on Zulip):

I mean, we haven't hit any road blocks

matklad (May 14 2019 at 16:31, on Zulip):

basically, both seem to be fast enough

matklad (May 14 2019 at 16:32, on Zulip):

Specifically, your insight about adding MacroDef to CallId showed that we can do expansion really incrementally

matklad (May 14 2019 at 16:32, on Zulip):

The bit I am still not sure about is handling hygiene

matklad (May 14 2019 at 16:33, on Zulip):

currently expansion is non-hygenic, and there's a chance that handling it properly will through a wrench into the works

matklad (May 14 2019 at 16:33, on Zulip):

So this is another specific bit worth digging into soon

matklad (May 14 2019 at 16:35, on Zulip):

that'll be a lot more trait queries though

@Florian Diebold not neccessary: I thin for this you first want to filter by identifier (we don't do this at all now), then by set of potentially importable traits, and only then by actual implements query

Florian Diebold (May 14 2019 at 16:36, on Zulip):

ah, I wasn't sure whether we're actually 'supposed' to filter server-side by LSP

matklad (May 14 2019 at 16:37, on Zulip):

In this case I think we should. And, just in general, we should handle sorting and filtering fully on the server side: I belive we are fundametally better positioned to do that.

Florian Diebold (May 14 2019 at 16:38, on Zulip):

yeah, I think e.g. prioritizing completions that give a matching type for the current expression would be cool as well

matklad (May 14 2019 at 16:39, on Zulip):

This actually reminds me of another thing which is worth focusing at in the near future: polish

matklad (May 14 2019 at 16:39, on Zulip):

We've "polished" chalk and macros recently in a sense that they no longer crash/hang

matklad (May 14 2019 at 16:40, on Zulip):

But I bet there is some work to be done to make recent additions more reliable

matklad (May 14 2019 at 16:40, on Zulip):

(especially around integration macros with name resolution, and integrating macros with IDE features)

nikomatsakis (May 14 2019 at 16:41, on Zulip):

So this is a very interesting question

nikomatsakis (May 14 2019 at 16:41, on Zulip):

Many people (including myself) are using rust-analyzer now

nikomatsakis (May 14 2019 at 16:41, on Zulip):

We have no real idea how many I think :)

nikomatsakis (May 14 2019 at 16:42, on Zulip):

But do we want to have some kind of mechanism for "feature gating" things like chalk etc that don't really improve people's lives yet?

matklad (May 14 2019 at 16:42, on Zulip):

Good question...

I think at this stage it's better to "commit fast, crash often"

matklad (May 14 2019 at 16:43, on Zulip):

As in, working on adding more features is more important than stability, b/c there are so many features missing

matklad (May 14 2019 at 16:44, on Zulip):

Though yeah, if we knew how many folks really need rust-analyzer, we would be able to make more informed descision here

matklad (May 14 2019 at 16:46, on Zulip):

@Igor Matuszewski are you around? What is the status of out-of-process rustc for rls?

matklad (May 14 2019 at 16:46, on Zulip):

I feel like that (out of process rustc, shared between rls and rls2) could be a good inflection point to start really focusing on stability

nikomatsakis (May 14 2019 at 16:48, on Zulip):

I think at this stage it's better to "commit fast, crash often"

isn't this a false dichotomy?

nikomatsakis (May 14 2019 at 16:48, on Zulip):

still, I agree it's far too early for a lot of procedure or feature-gates

nikomatsakis (May 14 2019 at 16:48, on Zulip):

I think I really just meant a single flag of some kind

nikomatsakis (May 14 2019 at 16:48, on Zulip):

"enable experiments" or not

matklad (May 14 2019 at 16:50, on Zulip):

I'd say that not a lot of people complained that rust-analyzer is broken recently

matklad (May 14 2019 at 16:50, on Zulip):

so that seems premature a bit

matklad (May 14 2019 at 16:50, on Zulip):

but in general :thumbs_up: on the idea

matklad (May 14 2019 at 16:50, on Zulip):

I originally intended to make every feature of rust-analyzer configurable

matklad (May 14 2019 at 16:51, on Zulip):

The problem with IDEs is that they have so many features, that some of them are neccessary annoying for some folks

matklad (May 14 2019 at 16:51, on Zulip):

and having a tooggle for everything seems nice for "power" users

matklad (May 14 2019 at 16:52, on Zulip):

configurable=disable-able ?

matklad (May 14 2019 at 16:53, on Zulip):

we are almost out of time

matklad (May 14 2019 at 16:53, on Zulip):

Does anyone else want to suggest something?

matklad (May 14 2019 at 16:53, on Zulip):

I personally covered everything I wanted to :)

nikomatsakis (May 14 2019 at 16:54, on Zulip):

this has been super interesting

nikomatsakis (May 14 2019 at 16:54, on Zulip):

I am very frustrated that I've not been able to participate at all with @Florian Diebold

nikomatsakis (May 14 2019 at 16:54, on Zulip):

and I know I certainly won't be able to until end of next week ;)

nikomatsakis (May 14 2019 at 16:54, on Zulip):

I am debating about something in my head and curious to put it out there

matklad (May 14 2019 at 16:55, on Zulip):

@Florian Diebold we could switch to fork of chalk then :devil:

nikomatsakis (May 14 2019 at 16:55, on Zulip):

(I mean I may be able to land a PR or something)

Florian Diebold (May 14 2019 at 16:56, on Zulip):

sorry, what do you mean by aprticipate :D normally I'm good at understanding typos, but I'm drawing a blank here ;)

nikomatsakis (May 14 2019 at 16:56, on Zulip):

participate

Florian Diebold (May 14 2019 at 16:56, on Zulip):

aah of course ;)

nikomatsakis (May 14 2019 at 16:57, on Zulip):

On the one hand, I want to see a "careful re-implementation" of Rust's type-checker, that aims for clarity, etc. I've thought that RLS 2.0 could provide such a path. On the other, I think it makes sense to push fast forward and try to "stand up" something that "seems to work". I think basically all I mean, really, by "careful re-implementation" is one where people like me (but not exclusively me) read over and try to compare to our expectations etc

nikomatsakis (May 14 2019 at 16:57, on Zulip):

I guess what i'm saying is : I think it's great, y'all should carry on, and I should think about how I can try to free up time and space to participate more.

matklad (May 14 2019 at 16:58, on Zulip):

/me realizes that he needs to run away really fast right now (or, better, ten minutes ago)

matklad (May 14 2019 at 16:58, on Zulip):

That was an awesome meeting, :wave: !

Florian Diebold (May 14 2019 at 16:59, on Zulip):

yeah, I can't really do the "careful" reimplementation, since I'm learning most of it as I go along ;) I can and do look at rustc of course, but there it's often hard to distinguish what is there because it handles some crucial edge case I don't understand yet, and what's there just because it grew that way

Igor Matuszewski (May 14 2019 at 18:21, on Zulip):

@matklad i’m sorry, couldn’t get a reliable connection for a while

Igor Matuszewski (May 14 2019 at 18:21, on Zulip):

No substantial progress has been made so far, I wanted to stsrt hacking on it after the lexer bit

pnkfelix (May 15 2019 at 09:16, on Zulip):

sorry I missed this meeting

pnkfelix (May 15 2019 at 09:16, on Zulip):

I'm still working on setting up infrastructure to test rust-analyzer's nameres system against the output of -Z save-analysis

matklad (May 15 2019 at 09:18, on Zulip):

Cool!

Last update: Nov 12 2019 at 15:55UTC