Skip to content

Commit 4eaab22

Browse files
author
Ehsan M. Kermani
committed
Content editorial
1 parent 0359604 commit 4eaab22

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

book/src/01_calculator/calc_intro.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
# Calculator
22

3-
Our first programming language is a simple calculator supporting addition and subtraction. This is perhaps the simplest language helping us introducing the major topics from grammar to compilation and virtual machine.
3+
Our first programming language is a simple calculator supporting addition and subtraction. This is perhaps the *simplest language* that helps us introducing the major topics from grammar to compilation and virtual machine.
44

5-
If you haven't cloned the [GitHub](https://github.com/ehsanmok/create-your-own-lang-with-rust) repo already, please do and navigate to the `calculator` crate
6-
7-
```text
8-
git clone https://github.com/ehsanmok/create-your-own-lang-with-rust
9-
cd create-your-own-lang-with-rust/calculator
10-
```
5+
If you haven't cloned the [GitHub](https://github.com/ehsanmok/create-your-own-lang-with-rust) repo already, please do and navigate to the `calculator` subdirectory.
116

127
To start, we have `1 + 1;` in [examples/simple.calc](../../../calculator/src/examples/simple.calc) where you can compile with
138

book/src/01_calculator/vm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ In a unary expression like `"1"`, we encode `Node::Int(1)` as the opcode `[1, 0,
3232

3333
### Bytecode
3434

35-
So we define
35+
We define
3636

3737
```rust,ignore
3838
{{#include ../../../calculator/src/compiler/vm/bytecode.rs:bytecode}}
3939
```
4040
<span class="filename">Filename: calculator/src/compiler/vm/bytecode.rs</span>
4141

42-
and as an example, `"1 + 2"` AST to Bytecode pictorially is
42+
and as an example, here is `"1 + 2"` AST to Bytecode conversion pictorially
4343

4444
<p align="center">
4545
</br>

book/src/intro.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
> Materials in this book are distributed under the terms of [Creative Commons BY-NC-SA 4.0](../../LICENSE)
1+
> Materials in this book are distributed under the terms of [Creative Commons BY-NC-SA 4.0](https://github.com/ehsanmok/create-your-own-lang-with-rust/blob/master/LICENSE)
22
> <p align="center">
33
> <a href><img alt="license" src="./img/by-nc-sa.png" width="250" height="100"> </a>
44
> </p>
55
6-
This book assumes some basic knowledge of Rust language. Please take a look at the official [Rust book](https://doc.rust-lang.org/book/).
6+
This book assumes some basic knowledge of Rust language. Please take a look at the official [Rust book](https://doc.rust-lang.org/book/).
77

8-
The accompanying codes and materials for this book are available in [GitHub](https://github.com/ehsanmok/create-your-own-lang-with-rust). To follow along, clone the repository
8+
The accompanying codes and materials for this book are available in [GitHub](https://github.com/ehsanmok/create-your-own-lang-with-rust). To follow along, make sure you have
99

10-
```text
11-
git clone https://github.com/ehsanmok/create-your-own-lang-with-rust
12-
cd create-your-own-lang-with-rust
13-
```
10+
* [Rust installed](https://www.rust-lang.org/tools/install)
11+
* Cloned the repository
12+
13+
```text
14+
git clone https://github.com/ehsanmok/create-your-own-lang-with-rust
15+
cd create-your-own-lang-with-rust
16+
```
17+
* LLVM v10.0 installed ([Debina/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm)) to run and test locally `cargo test --tests`
1418
1519
## Motivations and Goals
1620
@@ -23,7 +27,7 @@ The following are my guidelines
2327
2428
> "If you can’t explain something in simple terms, you don’t understand it" <sup>[2](https://skeptics.stackexchange.com/questions/8742/did-einstein-say-if-you-cant-explain-it-simply-you-dont-understand-it-well-en)</sup>
2529
26-
<span style="font-family:Trebuchet MS"> Pedagogically, one of the most effect methods of teaching is co-creating interactively. Introducing the core aspects around the *simplest example* (here, our calculator language) helps a lot to build knowledge and confidence. For that, we will use mature technologies instead of spending tone of time on partially reinventing-the-wheel and bore the reader.</span>
30+
<span style="font-family:Trebuchet MS"> Pedagogically, one of the most effective methods of teaching is co-creating interactively. Introducing the core aspects around the *simplest example* (here, our calculator language) helps a lot to build knowledge and confidence. For that, we will use mature technologies instead of spending tone of time on partially reinventing-the-wheel and bore the reader.</span>
2731
2832
Here is the outline of the contents
2933

0 commit comments

Comments
 (0)