Skip to content

Commit 0ecec39

Browse files
committed
Merge #137: Minor Clean Up
5fc590a Clean Up Comments (iajhff) Pull request description: Ok I have simplified my pull request. Thanks ACKs for top commit: apoelstra: ACK 5fc590a; successfully ran local tests Tree-SHA512: b6ca05d4dceedd4d8f6dd30e24b523f77f4d7e5af7a7455596553ff9a3fb6ce49e602e5b231d2a7b338a97a6f1960e9d1ad28919c30765fe99f46cf3744dfea1
2 parents 95ce043 + 5fc590a commit 0ecec39

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Simplicity introduces a groundbreaking low-level programming language and machin
2929
The distinguishing aspects that set Simplicity apart from conventional programming languages are:
3030

3131
- **Distinct Programming Paradigm**: Simplicity's programming model requires a paradigm shift from conventional programming. It hinges on reasoning about programs in a functional sense with a focus on combinators. This intricacy surpasses even popular functional languages like Haskell, with its own unique challenges.
32-
- **Exceptional Low-Level Nature**: Unlike high-level languages such as JavaScript or Python, Simplicity operates at an extremely low level, resembling assembly languages. This design choice enables easier reasoning about the formal semantics of programs, but is really work on directly.
32+
- **Exceptional Low-Level Nature**: Unlike high-level languages such as JavaScript or Python, Simplicity operates at an extremely low level, resembling assembly languages. This design choice enables easier reasoning about the formal semantics of programs, but is rarely worked on directly.
3333

3434
## SimplicityHL
3535

36-
SimplicityHL is a high-level language that compiles to Simplicity. It maps programming concepts from Simplicity onto programming concepts that developers are more familar with. In particular, Rust is a popular language whose functional aspects fit Simplicity well. SimplicityHL aims to closely resemble Rust.
36+
SimplicityHL is a high-level language that compiles to Simplicity. It maps programming concepts from Simplicity onto programming concepts that developers are more familiar with. In particular, Rust is a popular language whose functional aspects fit Simplicity well. SimplicityHL aims to closely resemble Rust.
3737

3838
Just how Rust is compiled to assembly language, SimplicityHL is compiled to Simplicity. Just how writing Rust doesn't necessarily produce the most efficient assembly, writing SimplicityHL doesn't necessarily produce the most efficient Simplicity code. The compilers try to optimize the target code they produce, but manually written target code can be more efficient. On the other hand, a compiled language is much easier to read, write and reason about. Assembly is meant to be consumed by machines while Rust is meant to be consumed by humans. Simplicity is meant to be consumed by Bitcoin full nodes while SimplicityHL is meant to be consumed by Bitcoin developers.
3939

book/src/function.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The function then checks if the carry is true, signaling an overflow, in which c
2222
On the last line, the value of `sum` is returned.
2323

2424
The above function is called by writing its name `add` followed by a list of arguments `(40, 2)`.
25-
Each parameter needs an argument, so the list of arguments is as long as the list of arguments.
25+
Each parameter needs an argument, so the list of arguments is as long as the list of parameters.
2626
Here, `x` is assigned the value `40` and `y` is assigned the value `2`.
2727

2828
```rust
@@ -54,7 +54,7 @@ fn level_1() -> u32 {
5454
}
5555

5656
fn level_2() -> u32 {
57-
let (_, next) = jet::increment_32(level_1));
57+
let (_, next) = jet::increment_32(level_1());
5858
next
5959
}
6060
```
@@ -91,7 +91,7 @@ There is no support for "libraries".
9191

9292
## Jets
9393

94-
Jets are predefined and optimized functions for common usecases.
94+
Jets are predefined and optimized functions for common use cases.
9595

9696
```rust
9797
jet::add_32(40, 2)

book/src/let_statement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let z: u32 = {
4848
assert!(jet::eq_32(y, 2)); // y == 2
4949
x
5050
};
51-
assert!(jet::eq_32(x, 3)); // z == 3
51+
assert!(jet::eq_32(z, 3)); // z == 3
5252
```
5353

5454
## Pattern matching

book/src/type.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ Arrays are always of finite length.
100100
| `List<A, 256>` | <256-list | `list![]`, …, `list![a1, …, a255]` |
101101
| `List<A, 512>` | <512-list | `list![]`, …, `list![a1, …, a511]` |
102102
||||
103-
| `List<A,`2<sup>N</sup>`>` | <2<sup>N</sup>-list | `list![]`, …, `list![a1, …, a`(2<sup>N</sup> - 1)`]` |
103+
| `List<A, 2^N>` | <2^N-list | `list![]`, …, `list![a1, …, a_{2^N - 1}]` |
104104

105105
Lists hold a variable number of elements of the same type.
106106
This is similar to [Rust vectors](https://doc.rust-lang.org/std/vec/struct.Vec.html), but SimplicityHL doesn't have a heap.
107-
In SimplicityHL, lists exists on the stack, which is why the maximum list length is bounded.
107+
In SimplicityHL, lists exist on the stack, which is why the maximum list length is bounded.
108108

109109
<2-lists hold fewer than 2 elements, so zero or one element.
110110
<4-lists hold fewer than 4 elements, so zero to three elements.
@@ -156,7 +156,7 @@ Sum types represent values that are of some "left" type in some cases and that a
156156
[They work just like in the either crate](https://docs.rs/either/latest/either/enum.Either.html).
157157
[The Result type from Rust is very similar, too](https://doc.rust-lang.org/std/result/index.html).
158158

159-
A sum type type is generic over two types, `A` and `B`.
159+
A sum type is generic over two types, `A` and `B`.
160160
The value `Left(a)` contains an inner value `a` of type `A`.
161161
The value `Right(b)` contains an inner value `b` of type `B`.
162162

book/src/type_casting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ All casting in SimplicityHL happens explicitly through a casting expression.
5757
```
5858

5959
The above expression casts the value `input` of type `Input` into some output type.
60-
The input type of the cast is explict while the output type is implicit.
60+
The input type of the cast is explicit while the output type is implicit.
6161

6262
In SimplicityHL, the output type of every expression is known.
6363

@@ -78,4 +78,4 @@ let x: u32 = <(u16, u16)>::into((0, 1));
7878
```
7979

8080
In the above example, we cast the tuple `(0, 1)` of type `(u16, u16)` into type `u32`.
81-
Feel free to consult the table above to verify that this is valid cast.
81+
Feel free to consult the table above to verify that this is a valid cast.

doc/environment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ During the translation, we can ignore the source type of Simplicity expressions
2222

2323
Target types are handled by contexts.
2424

25-
We obtain context Ctx(Ξ) from environment Ξ by mapping each variable `a` from Ξ to the target type of Ξ(`x`):
25+
We obtain context Ctx(Ξ) from environment Ξ by mapping each variable `x` from Ξ to the target type of Ξ(`x`):
2626

2727
Ctx(Ξ)(`x`) = B if Ξ(`x`) = a: A → B
2828

@@ -37,7 +37,7 @@ As we translate `s` to Simplicity, we need an environment that maps the variable
3737

3838
If `p` is just a variable `p = a`, then the environment is simply [`a` ↦ iden: A → A].
3939

40-
If `p` is a product of two variables `p = (a, b)`, then the environment is [`a` ↦ take iden: A × B → A, `b` ↦ drop iden: A × B → B.
40+
If `p` is a product of two variables `p = (a, b)`, then the environment is [`a` ↦ take iden: A × B → A, `b` ↦ drop iden: A × B → B].
4141

4242
"take" and "drop" are added as we go deeper in the product hierarchy. The pattern `_` is ignored.
4343

doc/translation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Then ⟦`b; c`⟧Ξ = comp (pair ⟦`b`⟧Ξ ⟦`c`⟧Ξ) (drop iden): A → C
7878

7979
If Ctx(Ξ) ⊩ `b`: B
8080

81-
If Product(PEnv(B, `p`), Ξ) ⊩ c: C
81+
If Product(PEnv(B, `p`), Ξ) ⊩ `c`: C
8282

8383
Then ⟦`let p: B = b; c`⟧Ξ = comp (pair ⟦`b`⟧Ξ iden) ⟦`c`⟧Product(PEnv(B, `p`), Ξ): A → C
8484

@@ -90,7 +90,7 @@ If Product(PEnv(B, `x`), Ξ) ⊩ `b`: D
9090

9191
If Product(PEnv(C, `y`), Ξ) ⊩ `c`: D
9292

93-
Then ⟦`match a { Left(x) => a, Right(y) => b, }`⟧Ξ = comp (pair ⟦a⟧Ξ iden) (case ⟦b⟧Product(PEnv(B, `x`), Ξ) ⟦c⟧Product(PEnv(C, `y`), Ξ)): A → D
93+
Then ⟦`match a { Left(x) => b, Right(y) => c, }`⟧Ξ = comp (pair ⟦`a`⟧Ξ iden) (case ⟦`b`⟧Product(PEnv(B, `x`), Ξ) ⟦`c`⟧Product(PEnv(C, `y`), Ξ)): A → D
9494

9595
## Left unwrap
9696

0 commit comments

Comments
 (0)