Skip to content

Commit 2112b93

Browse files
committed
Update architecture.md with correct paths and links
- Fix file paths to reflect crates/ directory structure - Update GitHub permalink references to current commit - Remove trailing slashes from package names - Use archive.org for broken desosa.nl link - Change master to main branch reference
1 parent 21c8496 commit 2112b93

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

architecture/architecture.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ The main entry point of RustPython is located in `src/main.rs` and simply forwar
7373
For each of the three components, the entry point is as follows:
7474

7575
- Parser: The Parser is located in a separate project, [RustPython/Parser][10]. See the documentation there for more information.
76-
- Compiler: `compile`, located in [`vm/src/vm/compile.rs`][11], this eventually forwards a call to [`compiler::compile`][12].
77-
- VM: `run_code_obj`, located in [`vm/src/vm/mod.rs`][13]. This creates a new frame in which the bytecode is executed.
76+
- Compiler: `compile`, located in [`crates/vm/src/vm/compile.rs`][11], this eventually forwards a call to [`compiler::compile`][12].
77+
- VM: `run_code_obj`, located in [`crates/vm/src/vm/mod.rs`][13]. This creates a new frame in which the bytecode is executed.
7878

7979
## Components
8080

8181
Here we give a brief overview of each component and its function. For more details for the separate crates please take a look at their respective READMEs.
8282

8383
### Compiler
8484

85-
This component, implemented as the `rustpython-compiler/` package, is responsible for translating a Python source file into its equivalent bytecode representation. As an example, the following Python file:
85+
This component, implemented as the `rustpython-compiler` package, is responsible for translating a Python source file into its equivalent bytecode representation. As an example, the following Python file:
8686

8787
```python
8888
def f(x):
@@ -111,7 +111,7 @@ The functionality for parsing resides in the RustPython/Parser project. See the
111111

112112
### VM
113113

114-
The Virtual Machine (VM) is responsible for executing the bytecode generated by the compiler. It is implemented in the `rustpython-vm/` package. The VM is currently implemented as a stack machine, meaning that it uses a stack to store intermediate results. In the `rustpython-vm/` package, additional sub-components are present, for example:
114+
The Virtual Machine (VM) is responsible for executing the bytecode generated by the compiler. It is implemented in the `rustpython-vm` package. The VM is currently implemented as a stack machine, meaning that it uses a stack to store intermediate results. In the `rustpython-vm` package, additional sub-components are present, for example:
115115

116116
- builtins: the built in objects of Python, such as `int` and `str`.
117117
- stdlib: parts of the standard library that contains built-in modules needed for the VM to function, such as `sys`.
@@ -158,7 +158,7 @@ The RustPython executable/REPL (Read-Eval-Print-Loop) is implemented here, which
158158
Some things to note:
159159

160160
- The CLI is defined in the [`run` function of `src/lib.rs`][16].
161-
- The interface and helper for the REPL are defined in this package, but the actual REPL can be found in `vm/src/readline.rs`
161+
- The interface and helper for the REPL are defined in this package, but the actual REPL can be found in `crates/vm/src/readline.rs`
162162

163163
### WASM
164164

@@ -169,18 +169,18 @@ Crate for WebAssembly build, which compiles the RustPython package to a format t
169169
Integration and snippets that test for additional edge-cases, implementation specific functionality and bug report snippets.
170170

171171
[1]: https://github.com/RustPython/RustPython
172-
[2]: https://2021.desosa.nl/projects/rustpython/posts/vision/
172+
[2]: https://web.archive.org/web/20240723122357/https://2021.desosa.nl/projects/rustpython/posts/vision/
173173
[3]: https://www.youtube.com/watch?v=nJDY9ASuiLc&t=213s
174174
[4]: https://rustpython.github.io/2020/04/02/thing-explainer-parser.html
175175
[5]: https://rustpython.github.io/demo/
176176
[6]: https://rustpython.github.io/demo/notebook/
177-
[7]: https://github.com/RustPython/RustPython/blob/master/DEVELOPMENT.md
177+
[7]: https://github.com/RustPython/RustPython/blob/main/DEVELOPMENT.md
178178
[8]: https://rustpython.github.io/guideline/2020/04/04/how-to-contribute-by-cpython-unittest.html
179-
[9]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/src/lib.rs#L63
179+
[9]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/src/lib.rs#L72
180180
[10]: https://github.com/RustPython/Parser
181-
[11]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/vm/src/vm/compile.rs#LL10C17-L10C17
182-
[12]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/vm/src/vm/compile.rs#L26
183-
[13]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/vm/src/vm/mod.rs#L356
184-
[14]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/common/src/float_ops.rs
181+
[11]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/crates/vm/src/vm/compile.rs#L10
182+
[12]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/crates/vm/src/vm/compile.rs#L26
183+
[13]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/crates/vm/src/vm/mod.rs#L433
184+
[14]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/crates/common/src/float_ops.rs
185185
[15]: https://rustpython.github.io/guideline/2020/04/04/how-to-contribute-by-cpython-unittest.html
186-
[16]: https://github.com/RustPython/RustPython/blob/0e24cf48c63ae4ca9f829e88142a987cab3a9966/src/lib.rs#L63
186+
[16]: https://github.com/RustPython/RustPython/blob/d36a2cffdef2218f3264cef9145a1f781d474ea3/src/lib.rs#L72

0 commit comments

Comments
 (0)