Skip to content

Commit 56fcc98

Browse files
committed
Some typos
1 parent 9b8651b commit 56fcc98

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Val aims to be:
88
- **Fast by definition**: Val is compiled ahead-of-time to machine code and relies on its type system to support in-place mutation and avoid unecessary memory allocations. Val avoids hidden costs such as implicit copies and therefore avoids heavy dependence on an optimizer for basic performance.
99
- **Safe by default**: Val's foundation of [mutable value semantics](http://www.jot.fm/issues/issue_2022_02/article2.pdf) ensures that ordinary code is memory safe, typesafe, and data-race-free. By explicit, auditable opt-in, programmers can use unsafe constructs for performance where necessary, and can build safe constructs using unsafe ones.
1010
- **Simple**: Val borrows heavily from [Swift](https://swift.org) which has demonstrated a user-friendly approach to generic programming and deep support for value semantics. Val's programming model strengthens and extends this support, while de-emphasizing reference semantics and avoiding the complexities that result from trying to make it statically safe (e.g., memory regions, lifetime annotations, etc.).
11-
- **Interoperable with C++**: Programming languages rarely survive in vacuum. Val aims to take advantage of the vast software capital of C++ by supporting full interoperability.
11+
- **Interoperable with C++**: Programming languages rarely survive in a vacuum. Val aims to take advantage of the vast software capital of C++ by supporting full interoperability.
1212

1313
The [language tour](./pages/language-tour.html) gives an overview of Val's features.
1414
The [specification](https://github.com/val-lang/specification/blob/main/spec.md) (work in progress) provides detailed information about Val's syntax and semantics.

pages/language-tour.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
---
44

55
This page gives a quick tour of Val's features in the form of a progressive guide.
6-
It assumes familiarity with an imperative programming language such as JavaScript, Python, C or C++..
6+
It assumes familiarity with an imperative programming language such as JavaScript, Python, C or C++.
77

88
This tour does not cover the entire language.
99
You may consult the [specification](https://github.com/val-lang/specification/blob/main/spec.md) for more information.
@@ -76,7 +76,7 @@ To run this program:
7676

7777
*Alternatively, you may put both source files in a subdirectory, say `Sources/`, and compile the program with `valc Sources -o hello`.*
7878

79-
Note that `greet` need not to be `public` to be visible from another file in the module.
79+
Note that `greet` need not be `public` to be visible from another file in the module.
8080
All entities declared at the top level of a file are visible everywhere in a module, but not beyond that module's boundary.
8181
{% comment %}
8282
Do we need to say, "unless marked private?"
@@ -490,7 +490,7 @@ public fun main() {
490490
```
491491

492492
In the program above, `m.components` can be modified because `m` is a mutable binding **and** the property `components` is mutable, as it is declared with `var`.
493-
Would that property be declared with `let`, the components of the matrix would remain immutable once the matrix has finished initializing, notwistaning the mutability of the binding to which it is assigned.
493+
Would that property be declared with `let`, the components of the matrix would remain immutable once the matrix has finished initializing, notwithstanding the mutability of the binding to which it is assigned.
494494

495495
Members that are not declared `public` cannot be accessed outside of the scope of a record type.
496496
As we uncover more advanced constructs, we will show how to exploit that feature to design clean and safe APIs.
@@ -597,7 +597,7 @@ fun scale(_ v: Vector2, by factor: Vector2) -> Vector2 {
597597
```
598598

599599
Argument labels are also useful to distinguish between different variants of the same operation.
600-
Further, note that Val does not suppoer type-based overloading, meaning that the only way for two functions to share the same name is to have different argument labels.
600+
Further, note that Val does not support type-based overloading, meaning that the only way for two functions to share the same name is to have different argument labels.
601601

602602
```val
603603
typealias Vector2 = (x: Double, y: Double)
@@ -639,7 +639,7 @@ public fun main() {
639639
}
640640
```
641641

642-
Function can have default values for their parameters:
642+
Functions can have default values for their parameters:
643643

644644
```val
645645
fun round(_ n: Double, digits: Int = 3) -> Double {
@@ -655,7 +655,7 @@ Hence, one may omit the second argument when calling it.
655655

656656
### Parameter passing conventions
657657

658-
A parameter passing conventions describes how the value of an argument is passed from caller to callee.
658+
A parameter passing convention describes how the value of an argument is passed from caller to callee.
659659
In other words, it describes the semantics of the language at function boundaries.
660660

661661
Val provides four different parameter passing conventions: `let`, `inout`, `sink` and `set`.
@@ -685,7 +685,7 @@ So there's a kind of contract between the caller and the callee: both agree not
685685
There's an additional clause in the fine print: the argument is "safe" to use at the entry of the function, meaning that it's fully initialized and that its invariants hold.
686686

687687
An important point to make from the outset is that, for all intents and purposes, this contract states that the value of a `let` parameter is independent from any other value a function might access.
688-
In turns, that property guarantees local reasoning and excludes a large class of problems attributed to spooky action at a distance.
688+
In return, this property guarantees local reasoning and excludes a large class of problems attributed to spooky action at a distance.
689689
Underneath the user model, the contract also enables a key strategy to efficiently compile pass by value semantics.
690690
Namely, because the value is guaranteed immutable, the compiler can compile `let` parameters with references.
691691

@@ -854,7 +854,7 @@ fun offset_sink(_ v: sink Vector2, by delta: Vector2) -> Vector2 {
854854
Here, the contract says not only that arguments to `sink` parameters are unique, but also that their ownership is transferred to the callee.
855855
Hence, a caller no can no longer access the value it has given to a `sink` parameter after the callee returns.
856856

857-
A C++ developer may understand the `sink` convention as *pass by rvalue reference*, with guarantee that the argument moves, and write the following below.
857+
A C++ developer may understand the `sink` convention as *pass by rvalue reference*, with the guarantee that the argument moves, and write the following below.
858858
Further, note that a move is a destructive operation in Val.
859859

860860
```c++
@@ -971,7 +971,7 @@ public fun main() {
971971
```
972972

973973
The program above declares `Vector2` a [record type](#records) with two public properties, a public memberwise initializer and a method.
974-
The latter is nearly identical to the free function we declaredin the section on [parameter passing conventions](#parameter-passing-conventions).
974+
The latter is nearly identical to the free function we declared in the section on [parameter passing conventions](#parameter-passing-conventions).
975975
The difference is that its first parameter has become implicit and is now named `self`.
976976

977977
In a method, `self` denotes the *receiver*, an implicit argument that refers to the value on which the method is called.
@@ -1280,7 +1280,7 @@ public fun main() {
12801280

12811281
### Subscript bundles
12821282

1283-
Just like methods, subscripts and member subscripts can bindle multiple implementations to represent different variant of the same functionality depending on the context in which the subscript is being used.
1283+
Just like methods, subscripts and member subscripts can bundle multiple implementations to represent different variant of the same functionality depending on the context in which the subscript is being used.
12841284

12851285
#### `inout` subscripts
12861286

@@ -1316,7 +1316,7 @@ public fun main() {
13161316

13171317
Here, the immutable variant of the subscript is synthesized from the mutable one.
13181318
In some cases, however, you may need to implement different behavior.
1319-
You such situations, you may bundle multiple implementations together:
1319+
In such situations, you may bundle multiple implementations together:
13201320

13211321
```
13221322
subscript min(_ x: yielded Int, _ y: yielded Int): Int {
@@ -1328,7 +1328,7 @@ subscript min(_ x: yielded Int, _ y: yielded Int): Int {
13281328
#### `set` subscripts
13291329

13301330
A `set` subscript does not project any value.
1331-
Instead, it used when the value produced by a subscript needs not to be used, but only assigned to a new value.
1331+
Instead, it is used when the value produced by a subscript need not be used, but only assigned to a new value.
13321332

13331333
A `set` subscript accepts an implicit `sink` parameter named `new_value` denoting the value to assign:
13341334

@@ -1346,7 +1346,7 @@ public fun main() {
13461346
```
13471347

13481348
In the program above, the value of the subscript is not required to perform the assigment.
1349-
So rather than applying the `inout` variant, the compiler will choses to apply the `set` variant.
1349+
So rather than applying the `inout` variant, the compiler will choose to apply the `set` variant.
13501350

13511351
#### `sink` subscripts
13521352

0 commit comments

Comments
 (0)