All Projects → rust-lang → Rustc Dev Guide

rust-lang / Rustc Dev Guide

Licence: other
A guide to how rustc works and how to contribute to it.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rustc Dev Guide

Tiramisu
A polyhedral compiler for expressing fast and portable data parallel algorithms
Stars: ✭ 685 (-13.18%)
Mutual labels:  compiler
Bic
A C interpreter and API explorer.
Stars: ✭ 719 (-8.87%)
Mutual labels:  compiler
Elm Platform
Bundle of all core development tools for Elm
Stars: ✭ 775 (-1.77%)
Mutual labels:  compiler
Jscl
A Lisp-to-Javascript compiler bootstrapped from Common Lisp
Stars: ✭ 688 (-12.8%)
Mutual labels:  compiler
Open C Book
开源书籍:《C语言编程透视》,配套视频课程《360° 剖析 Linux ELF》已上线,视频讲解更为系统和深入,欢迎订阅:https://www.cctalk.com/m/group/88089283
Stars: ✭ 715 (-9.38%)
Mutual labels:  compiler
Vtil Core
Virtual-machine Translation Intermediate Language
Stars: ✭ 738 (-6.46%)
Mutual labels:  compiler
Esper
Esper Complex Event Processing, Streaming SQL and Event Series Analysis
Stars: ✭ 680 (-13.81%)
Mutual labels:  compiler
Tinycc
Unofficial mirror of mob development branch
Stars: ✭ 784 (-0.63%)
Mutual labels:  compiler
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (-9.25%)
Mutual labels:  compiler
J2cl
Java to Closure JavaScript transpiler
Stars: ✭ 773 (-2.03%)
Mutual labels:  compiler
Marked
A markdown parser and compiler. Built for speed.
Stars: ✭ 26,556 (+3265.78%)
Mutual labels:  compiler
Csharp.lua
The C# to Lua compiler
Stars: ✭ 712 (-9.76%)
Mutual labels:  compiler
Caramel
🍬 a functional language for building type-safe, scalable, and maintainable applications
Stars: ✭ 756 (-4.18%)
Mutual labels:  compiler
Constexpr 8cc
Compile-time C Compiler implemented as C++14 constant expressions
Stars: ✭ 687 (-12.93%)
Mutual labels:  compiler
Numba
NumPy aware dynamic Python compiler using LLVM
Stars: ✭ 7,090 (+798.61%)
Mutual labels:  compiler
Mlton
The MLton repository
Stars: ✭ 683 (-13.43%)
Mutual labels:  compiler
Tl
The compiler for Teal, a typed dialect of Lua
Stars: ✭ 716 (-9.25%)
Mutual labels:  compiler
Typescripttolua
Typescript to lua transpiler. https://typescripttolua.github.io/
Stars: ✭ 783 (-0.76%)
Mutual labels:  compiler
Compiler
Compiler for Elm, a functional language for reliable webapps.
Stars: ✭ 6,672 (+745.63%)
Mutual labels:  compiler
Pyret Lang
The Pyret language.
Stars: ✭ 771 (-2.28%)
Mutual labels:  compiler

Travis CI badge

This is a collaborative effort to build a guide that explains how rustc works. The aim of the guide is to help new contributors get oriented to rustc, as well as to help more experienced folks in figuring out some new part of the compiler that they haven't worked on before.

You can read the latest version of the guide here.

You may also find the rustdocs for the compiler itself useful. Note that these are not intended as a guide; it's recommended that you search for the docs you're looking for instead of reading them top to bottom.

Contributing to the guide

The guide is useful today, but it has a lot of work still to go.

If you'd like to help improve the guide, we'd love to have you! You can find plenty of issues on the issue tracker. Just post a comment on the issue you would like to work on to make sure that we don't accidentally duplicate work. If you think something is missing, please open an issue about it!

In general, if you don't know how the compiler works, that is not a problem! In that case, what we will do is to schedule a bit of time for you to talk with someone who does know the code, or who wants to pair with you and figure it out. Then you can work on writing up what you learned.

In general, when writing about a particular part of the compiler's code, we recommend that you link to the relevant parts of the rustc rustdocs.

Build Instructions

To build a local static HTML site, install mdbook with:

> cargo install mdbook mdbook-linkcheck mdbook-toc

and execute the following command in the root of the repository:

> mdbook build

The build files are found in the book directory.

Link Validations

We use mdbook-linkcheck to validate URLs included in our documentation. linkcheck will be run automatically when you build with the instructions in the section above.

Table of Contents

We use mdbook-toc to auto-generate TOCs for long sections. You can invoke the preprocessor by including the <!-- toc --> marker at the place where you want the TOC.

Pre-commit script

We also test that line lengths are less than 100 columns. To test this locally, you can run ci/check_line_lengths.sh.

You can also set this to run automatically.

On Linux:

ln -s ../../ci/check_line_lengths.sh .git/hooks/pre-commit

On Windows:

New-Item -Path .git/hooks/pre-commit -ItemType HardLink -Value <absolute_path/to/check_line_lengths.sh>

How to fix toolstate failures

NOTE: Currently, we do not track the rustc-dev-guide toolstate due to spurious failures, but we leave these instructions for when we do it again in the future.

  1. You will get a ping from the toolstate commit. e.g. https://github.com/rust-lang-nursery/rust-toolstate/commit/8ffa0e4c30ac9ba8546b7046e5c4ccc2b96ebdd4

  2. The commit contains a link to the PR that caused the breakage. e.g. https://github.com/rust-lang/rust/pull/64321

  3. If you go to that PR's thread, there is a post from bors with a link to the CI status: https://github.com/rust-lang/rust/pull/64321#issuecomment-529763807

  4. Follow the check-actions link to get to the Actions page for that build

  5. There will be approximately 1 billion different jobs for the build. They are for different configurations and platforms. The rustc-dev-guide build only runs on the Linux x86_64-gnu-tools job. So click on that job in the list, which is about 60% down in the list.

  6. Click the Run build step in the job to get the console log for the step.

  7. Click on the log and Ctrl-f to get a search box in the log

  8. Search for rustc-dev-guide. This gets you to the place where the links are checked. It is usually ~11K lines into the log.

  9. Look at the links in the log near that point in the log

  10. Fix those links in the rustc-dev-guide (by making a PR in the rustc-dev-guide repo)

  11. Make a PR on the rust-lang/rust repo to update the rustc-dev-guide git submodule in src/docs/rustc-dev-guide. To make a PR, the following steps are useful.

# Assuming you already cloned the rust-lang/rust repo and you're in the correct directory
git submodule update --remote src/doc/rustc-dev-guide
git add -u
git commit -m "Update rustc-dev-guide"
# Note that you can use -i, which is short for --incremental, in the following command
./x.py test --incremental src/doc/rustc-dev-guide # This is optional and should succeed anyway
# Open a PR in rust-lang/rust
  1. Wait for PR to merge

Voilà!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].