Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for "Compiler walkthrough" section #1062

Open
4 of 7 tasks
camelid opened this issue Feb 18, 2021 · 5 comments
Open
4 of 7 tasks

Tracking issue for "Compiler walkthrough" section #1062

camelid opened this issue Feb 18, 2021 · 5 comments

Comments

@camelid
Copy link
Member

camelid commented Feb 18, 2021

@camelid camelid changed the title "Compiler walkthrough" section Tracking issue for "Compiler walkthrough" section Feb 18, 2021
@camelid
Copy link
Member Author

camelid commented Feb 18, 2021

As we discussed in the meeting, we're going to show each pass of the compiler,
each intermediate representation (before & after pass), and some internal data
structures (like TyCtxt).

However, we're going to start with just showing tokens, AST, and HIR (with no
internal data structures) going through the passes of lex, parse, resolve, and
macro-expand, which are actually interleaved together:

lex -> (parse <-> resolve <-> expand)

We're going to start with this example code (I modified it
slightly to use @LeSeulArtichaut's name suggestion, and to change String to
&str, which is more idiomatic and will let us show lifetimes in action):

fn is_awesome(name: &str) -> bool {
    matches!(name, "Rust" | "Ferris")
}

(See the Zulip discussion for details on why we chose this example.)

@camelid
Copy link
Member Author

camelid commented Mar 3, 2021

  • Implement (an MVP of) -Z dump-internal-data [@camelid]

What do you think would be a good MVP for -Z dump-internal-data? Maybe print the type of everything in the program?

@LeSeulArtichaut
Copy link
Contributor

LeSeulArtichaut commented Mar 3, 2021

"Internal data" is very broad. Let's maybe try to make a list of all the things we would like to be able to dump?

@camelid
Copy link
Member Author

camelid commented Mar 3, 2021

Sounds like a good idea :)

@LeSeulArtichaut
Copy link
Contributor

Opened https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/-Z.20dump-internal-data for discussion about -Z dump-internal-data

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 4, 2021
…storino

Add `-Z unpretty` flags for the AST

Implements rust-lang/compiler-team#408.
Builds on rust-lang#82269, but if that PR is rejected or stalls out, I can implement this without rust-lang#82269.
cc rust-lang/rustc-dev-guide#1062
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 4, 2021
…orino

Add `-Z unpretty` flags for the AST

Implements rust-lang/compiler-team#408.
Builds on rust-lang#82269, but if that PR is rejected or stalls out, I can implement this without rust-lang#82269.
cc rust-lang/rustc-dev-guide#1062
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…astorino

Add `-Z unpretty` flag for the THIR

This adds a new perma-unstable flag, `-Zunpretty=thir-tree`, that dumps the raw THIR tree for each body in the crate.

Implements the THIR part of MCP rust-lang/compiler-team#408, helps with rust-lang/rustc-dev-guide#1062.
Depends on rust-lang#82495, blocked on that. Only the two last commits are added by this PR.
r? `@spastorino` cc `@estebank`
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…astorino

Add `-Z unpretty` flag for the THIR

This adds a new perma-unstable flag, `-Zunpretty=thir-tree`, that dumps the raw THIR tree for each body in the crate.

Implements the THIR part of MCP rust-lang/compiler-team#408, helps with rust-lang/rustc-dev-guide#1062.
Depends on rust-lang#82495, blocked on that. Only the two last commits are added by this PR.
r? ``@spastorino`` cc ``@estebank``
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 11, 2021
…astorino

Add `-Z unpretty` flag for the THIR

This adds a new perma-unstable flag, `-Zunpretty=thir-tree`, that dumps the raw THIR tree for each body in the crate.

Implements the THIR part of MCP rust-lang/compiler-team#408, helps with rust-lang/rustc-dev-guide#1062.
Depends on rust-lang#82495, blocked on that. Only the two last commits are added by this PR.
r? ```@spastorino``` cc ```@estebank```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants