Skip to content

Commit

Permalink
feat(docs): Add architectural flowchart
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Jan 28, 2025
1 parent c4f638e commit cc2ab02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/contributor/compiler_walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ We'll largely be following the `next_state` function in [compile.re](https://git

## An overview of the compiler

![Flowchart illustrating an architectural model of the grain compiler.](grain_architecture.png)

The Grain compiler is a [multi-stage](https://en.wikipedia.org/wiki/Multi-pass_compiler) compiler, which means instead of converting directly from Grain syntax into `wasm` code, we send the input program through multiple phases, transforming from one intermediate representation to the next until we get to the final output. This approach allows us to have a more maintainable compiler and perform deeper analysis of the source code, which lets us provide better errors and better code output.

## File Structure
Expand Down
Binary file added docs/contributor/grain_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc2ab02

Please sign in to comment.