Stream: t-compiler/wg-learning

Topic: Next steps


Santiago Pastorino (Feb 19 2020 at 21:51, on Zulip):

we can find next tasks here https://hackmd.io/nr5Ww319TnWM2HL_cg5I-w?view#Tasks

Santiago Pastorino (Feb 19 2020 at 21:52, on Zulip):

I wanted to mention a couple of things ...

Santiago Pastorino (Feb 19 2020 at 21:52, on Zulip):

I think the ones assigned are clearly defined and actionable now

Santiago Pastorino (Feb 19 2020 at 21:53, on Zulip):

the rest needs discussion and more definition IMO

Santiago Pastorino (Feb 19 2020 at 21:53, on Zulip):

and are actually the ones that will keep us busy

Santiago Pastorino (Feb 19 2020 at 21:53, on Zulip):

the ones defined are more like organizational

Santiago Pastorino (Feb 19 2020 at 21:54, on Zulip):

so ... I think we can now start our sprint with a little planning meeting where we define and prioritize a bit better these tasks:

Santiago Pastorino (Feb 19 2020 at 21:55, on Zulip):
Santiago Pastorino (Feb 19 2020 at 21:56, on Zulip):

btw, I've added an idea there that after reading the log of the meeting was very badly explained by me and then of course misunderstood :P

Santiago Pastorino (Feb 19 2020 at 21:56, on Zulip):

@mark-i-m when I was talking about the walkthrough section I think there are two things

Santiago Pastorino (Feb 19 2020 at 21:57, on Zulip):

one is having Rust code and explaining what the compiler does to your code

Santiago Pastorino (Feb 19 2020 at 21:57, on Zulip):

the other new idea I was proposing is more like a contributing one, where we show how a particular feature was implemented by explaining every corner of the compiler that was touched

Santiago Pastorino (Feb 19 2020 at 22:03, on Zulip):

I've also added Collect a set of PRs that help understanding some parts of the compiler which we didn't discuss but was an idea I had that sounded interesting to Wesley Wiser and nikomatsakis when I've commented to them

mark-i-m (Feb 20 2020 at 18:10, on Zulip):

Thanks @Santiago Pastorino!

mark-i-m (Feb 20 2020 at 18:10, on Zulip):

A quick question:

Write an Overview chapter
Write a walkthrough section about what the compiler does to your code

What is the difference between these?

mark-i-m (Feb 20 2020 at 18:12, on Zulip):

Write a walkthrough about how a full feature is implemented

I'm not sure I understand how this is different from the existing feature or the above bullet points? What's the objective you imagine for such a chapter?

Santiago Pastorino (Feb 20 2020 at 18:51, on Zulip):

mark-i-m said:

A quick question:

Write an Overview chapter
Write a walkthrough section about what the compiler does to your code

What is the difference between these?

well at some point we had a distinction between those but I'm not sure if we really want to merge them or what do we want to do, I guess it's fine to merge them

Santiago Pastorino (Feb 20 2020 at 18:51, on Zulip):

so ... there's an overview, more like explaining briefly the different parts of the compiler

Santiago Pastorino (Feb 20 2020 at 18:52, on Zulip):

but then there's an idea of using one example, and kind of guide the reader through what happens when you compile that code

Santiago Pastorino (Feb 20 2020 at 18:52, on Zulip):

which may involve talking about some data structures, talking about different representations we see along the way like MIR, etc

Santiago Pastorino (Feb 20 2020 at 18:52, on Zulip):

I guess the overview could be just a high level idea of how things work

Santiago Pastorino (Feb 20 2020 at 18:53, on Zulip):

mostly what we currently have on hackmd but more complete

Santiago Pastorino (Feb 20 2020 at 18:53, on Zulip):

anyway, as I've said, it may be that we want both things in the same chapter

Santiago Pastorino (Feb 20 2020 at 18:53, on Zulip):

all I want to say is that it would be good to have both things :)

Santiago Pastorino (Feb 20 2020 at 18:54, on Zulip):

mark-i-m said:

Write a walkthrough about how a full feature is implemented

I'm not sure I understand how this is different from the existing feature or the above bullet points? What's the objective you imagine for such a chapter?

so ... we have 4 things that may be confusing

Santiago Pastorino (Feb 20 2020 at 18:54, on Zulip):
  1. overview this imo is more or less what we have in the hackmd you have cooked. A high level explanation of the different parts of the compiler
Santiago Pastorino (Feb 20 2020 at 18:55, on Zulip):
  1. we have the existing walkthrough contributing section (this one is the one that is very different from the rest), in that section we've explained the procedure to contribute without any technical aspect of the compiler
Santiago Pastorino (Feb 20 2020 at 18:56, on Zulip):
  1. a walkthrough about a sample program ... here we have user code and we explain what the compiler does when you compile it. We explain the different pases and things
Santiago Pastorino (Feb 20 2020 at 18:57, on Zulip):
  1. a walkthrough about how a feature is implemented ... here we choose a feature implemented in the compiler, no idea which one could be but imagine the adition of async
Santiago Pastorino (Feb 20 2020 at 18:58, on Zulip):

so we first explain ... well this is implemented in PR #XYZ, and we explain every step of the PR

Santiago Pastorino (Feb 20 2020 at 18:58, on Zulip):

this last one could serve as a contributing example

Santiago Pastorino (Feb 20 2020 at 18:58, on Zulip):

so if I need to add something to the parsing phase I can check what was done there

mark-i-m (Feb 21 2020 at 20:07, on Zulip):

Ah, I see. Thanks for clarifying that.

mark-i-m (Feb 21 2020 at 20:08, on Zulip):

I guess I'm skeptical if it's meaningful to try to add all of those. For example, I'm skeptical that there is a PR or set of PRs that one make a useful example of what parts of the compiler I might want to change...

mark-i-m (Feb 21 2020 at 20:11, on Zulip):

I'm also wary of over-burdening ourselves by trying to produce too much material. If I recall correctly there was an expressed desire for (1) and (3), but I was under the impression that we wanted these to be high-level and merged into one thing... that is, others had expressed that the guide goes into a lot of detail on each single topic, but it's hard to see how they all fit together. It seems like some combination of 1 and 3 would address that.

mark-i-m (Feb 21 2020 at 20:11, on Zulip):

I guess I'm kind of rambling

mark-i-m (Feb 21 2020 at 20:13, on Zulip):

I'm curious what others think:

centril (Feb 21 2020 at 21:25, on Zulip):

@mark-i-m at some point, the rustc-guide will start being more of a spec than the reference :D

centril (Feb 21 2020 at 21:25, on Zulip):

I think we should consider extracting some parts into the reference over time

centril (Feb 21 2020 at 21:25, on Zulip):

or build a new reference

Santiago Pastorino (Feb 21 2020 at 21:59, on Zulip):

mark-i-m said:

I'm also wary of over-burdening ourselves by trying to produce too much material. If I recall correctly there was an expressed desire for (1) and (3), but I was under the impression that we wanted these to be high-level and merged into one thing... that is, others had expressed that the guide goes into a lot of detail on each single topic, but it's hard to see how they all fit together. It seems like some minimal combination of 1 and 3 would address that without requiring a lot of extra chapters?

I'm not sure I want these things to be separate and we don't necessarily need to start rushing towards accomplishing that. I just brought that up for discussion, for future consideration and all that. I think 1 and 3, we all agree. Maybe the other thing we can do for now is try to add a collection of interesting PRs somwhere

Santiago Pastorino (Feb 21 2020 at 21:59, on Zulip):

I'm referring to this point :point_up:

mark-i-m (Feb 22 2020 at 18:47, on Zulip):

@centril Could you clarify what you mean? I feel that almost everything in the guide is about either procedure or implementation, rather than behavior (except maybe some of the chalk chapters)

centril (Feb 23 2020 at 02:39, on Zulip):

@mark-i-m fair; I guess that's true, though I would like to see the reference become more like a "reference implementation" style thing where we use more formal specification and less informal English

centril (Feb 23 2020 at 02:39, on Zulip):

and the rustc guide is probably very helpful towards that goal

Chris Simpkins (Feb 23 2020 at 15:04, on Zulip):

@mark-i-m @Santiago Pastorino

I took a pass through the Overview outline, added all missing links, a few additions to the outilne itself, and a detailed References section with links to the rustc guide and source documentation. I created bold TODO's where information is missing or there are questions.

I have a couple of additional thoughts. It would be helpful to have source entry point links for each of these sections in the Overview. This would serve as a jumping off point where readers can begin to explore the source after they read a section of the Overview. It would also be helpful to succinctly summarize (or link to references that describe) available approaches to explore the various levels of source representation to machine code during the compile process. e.g., cargo rustc -- -Zunpretty=hir-tree for HIR. This would support an approach for readers to draft small bodies of source and explore levels of representation as they run through the Overview and dig deeper into detailed information in the sections of the rustc guide.

I will get started on the Overview blog post outline this evening.

Chris Simpkins (Feb 23 2020 at 15:33, on Zulip):

Santiago Pastorino said:

mark-i-m when I was talking about the walkthrough section I think there are two things
one is having Rust code and explaining what the compiler does to your code

Sorry, I didn't read see this section before I wrote my comments above. This walkthrough sounds like the spot for information on how to visualize HIR > MIR > LLVM IR representations of source through the compile phases. I really like the idea of a walkthrough on this. I added a bullet point under that item for the how to do it piece.

Last update: Apr 03 2020 at 15:50UTC