|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "An Update from WG-Learning" |
| 4 | +author: mark-i-m |
| 5 | +team: the Learning Working Group <https://www.rust-lang.org/governance/teams/compiler#wg-learning> |
| 6 | +--- |
| 7 | + |
| 8 | +# An update from WG-Learning |
| 9 | + |
| 10 | +In our last post in [October][oct] we gave an overview what the Learning WG is |
| 11 | +and what we are doing. We have made a lot of progress since that post, and we |
| 12 | +have also held a meeting to decide what to work on next. So let's dig in... |
| 13 | + |
| 14 | +## Work completed |
| 15 | + |
| 16 | +We mentioned before that we are in the process of producing [rustc-guide][rg] |
| 17 | +chapters from the "Compiler Lecture Series" videos. The goal is to try to |
| 18 | +produce guide chapters that are approachable for beginners and give a good |
| 19 | +foundation for exploring and hacking on the compiler. |
| 20 | + |
| 21 | +Recently, we merge a [chapter][salsach] on [`salsa`][salsa] by `@Karrq`. |
| 22 | +`salsa` is a crate that makes incremental computation easier. While it is not |
| 23 | +used in `rustc` itself, it is heavily inspired by it, and it is used by |
| 24 | +[`rust-analyzer`][ra]. |
| 25 | + |
| 26 | +We also collectively have been working on a chapter about [`ty::Ty`][ty] and |
| 27 | +the way that rustc represents types internally. You can find that PR |
| 28 | +[here][typr]. This has been a big effort for a few months now, and we are excited |
| 29 | +to have this new chapter in the guide. |
| 30 | + |
| 31 | +## What's next? |
| 32 | + |
| 33 | +We just had a [planning meeting][meeting] to discuss what to work on next. The |
| 34 | +guide has some long-standing holes and shortcomings that we would like to address. |
| 35 | + |
| 36 | +Specifically, the Learning WG decided that we wanted to pursue the following goals next: |
| 37 | +- Write an overview chapter |
| 38 | +- Gather source material for chapters on monomorphization and LLVM |
| 39 | + |
| 40 | +### Overview chapter |
| 41 | + |
| 42 | +One of the challenges with big software systems is understanding how everything |
| 43 | +fits together. We have seen this problem come up with the rustc-guide; the chapters |
| 44 | +tunnel down into a single part of the compiler, but it is hard to get a good |
| 45 | +view of all the things that happen to a piece of code between lexing and linking. |
| 46 | + |
| 47 | +We want to remedy this problem by creating an Overview chapter that walks |
| 48 | +through some example from the beginning of the compiler to the end of the |
| 49 | +compiler at a high level. We plan to put this chapter at the beginning of |
| 50 | +(part 2 of) the guide, so that it guide readers as to what part of the |
| 51 | +compilation they are reading about in the subsequent chapters. |
| 52 | + |
| 53 | +### Monomorphization, Codegen, LLVM |
| 54 | + |
| 55 | +One of the biggest gaps in the guide currently is what happens to your code |
| 56 | +after the MIR is produced. We have chapters on almost everything that happens |
| 57 | +before that (though many of them are pretty slim), but we have almost nothing |
| 58 | +after the MIR is produced, borrow checked, and optimized. |
| 59 | + |
| 60 | +In particular, after the MIR is optimized, we need to [monomorphize][glos] it, |
| 61 | +produce LLVM IR from it, call LLVM to produce executable code, and then link |
| 62 | +everything to form a final binary object. |
| 63 | + |
| 64 | +The Learning WG will work on collecting information to write chapters on these |
| 65 | +topics. |
| 66 | + |
| 67 | +## Getting involved |
| 68 | + |
| 69 | +Did any of this sound interesting to you? We would love for you to join us! You |
| 70 | +can the Learning WG on the [`t-compiler/wg-learning`][zulip] stream on Zulip. |
| 71 | +Feel free to stop by and ping us. |
| 72 | + |
| 73 | + |
| 74 | +[oct]: https://blog.rust-lang.org/inside-rust/2019/10/28/rustc-learning-working-group-introduction.html |
| 75 | +[rg]: https://rust-lang.github.io/rustc-guide/ |
| 76 | +[salsa]: https://crates.io/crates/salsa |
| 77 | +[salsach]: https://rust-lang.github.io/rustc-guide/salsa.html |
| 78 | +[ra]: https://github.com/rust-analyzer/rust-analyzer |
| 79 | +[ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/type.Ty.html |
| 80 | +[typr]: https://github.com/rust-lang/rustc-guide/pull/530 |
| 81 | +[meeting]: https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-learning/topic/planning.20meeting |
| 82 | +[glos]: https://rust-lang.github.io/rustc-guide/appendix/glossary.html |
| 83 | +[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-learning |
0 commit comments