You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,27 +6,27 @@ The goal of this model is to provide a starting point for modeling extensions to
6
6
For example, for a research project we have built an extended type system for WebAssembly on top of this model.
7
7
There are two straightforward ways to build language extensions using this model:
8
8
9
-
1. The preferred way is to use Redex's `define-extended-*` forms to explicity extend the basic WebAssembly specification. For example, using `define-extended-language` to extend the base WebAssembly syntax with new types or instructions, and then using `define-extended-relation` and `define-extended-judgment` when necessary, or creating new reduction relations and judgement forms.
9
+
1. The preferred way is to use Redex's `define-extended-*` forms to explicitly extend the basic WebAssembly specification. For example, using `define-extended-language` to extend the base WebAssembly syntax with new types or instructions, and then using `define-extended-relation` and `define-extended-judgment` when necessary, or creating new reduction relations and judgement forms.
10
10
2. Create a fork of this repository, and change the language definition, reduction relation, and judgment forms as needed.
11
11
12
12
## Syntax
13
13
The syntactic representation used in the model is `s-expression` based.
14
-
It contains a few more parentheses than are present in the original grammer (to speed up parsing).
14
+
It contains a few more parentheses than are present in the original grammar (to simplify parsing).
15
15
Other small differences include:
16
16
* The removal of the `.` character between types and a number of terminal expressions (e.g., `i32.add` becomes `(i32 add)`).
17
17
* The explicit enumeration of the `sx` non-terminal in binops and relops.
18
18
* Optional terms are handled via enumeration or faked using lists (there's a hidden low-priority TODO to clean this up).
19
19
20
-
The WASM Redex language is defined in `Syntax.rkt`. A typeset version can be viewed below and uses similar terminology to the WebAssembly paper.
20
+
The WASM Redex syntax is defined in `Syntax.rkt`. A typeset version can be viewed below and uses similar terminology to the WebAssembly paper.
21
21
22
22

23
23
24
24
## Semantics
25
25
WebAssembly introduces several administrative instructions to define the semantics.
26
26
Therefore, we extend the base WebAssembly syntax with these forms to create a run-time language, `WASM-Admin`, defined in 
27
27
28
-
The reduction relation is in the form of a small-step operational semantics inside an evaluation context.
29
-
The evaluation context, L, keeps track of the list of instructions surrounding the current code block.
28
+
The reduction relation is a small-step operational semantics inside an evaluation context.
29
+
The evaluation context, `L`, keeps track of the list of instructions surrounding the current code block.
30
30
Evaluation contexts can be thought of as being akin to a stack frame.
31
31
There are four parameters: `(s v* e*) (-> i) (s v* e*)` with roughly equivalent meaning to the ones in the paper:
32
32
*`s`: the store which keeps track of all instances (modules), as well as all function tables and memories.
@@ -46,13 +46,13 @@ The typing rules for instructions are defined in ![Validation/InstructionTyping.
46
46
The typing rules for modules and module objects (tables, memories, globals, and functions) are defined in `Validation/ModuleTyping.rkt`,
47
47
which provides the `⊢-module-func`, `⊢-module-global`, `⊢-module-table`, `⊢-module-memory`, and `⊢-module` judgment-forms.
48
48
49
-
In `Validation/Typechecking.rkt` we provide an algorithm for finding a derivation that types a given syntax object.
50
-
This algorithm is more complicated than the reference validation algorithm since it needs to synthesize the actual program stacks for instructions after unconditional branches and `unreachable`.
49
+
In `Validation/Typechecking.rkt` we provide an inference algorithm for finding a typing derivation over syntax.
50
+
This algorithm is more complicated than the reference validation algorithm since it produces a derivation witness, and needs to synthesize the actual program stacks for instructions after unconditional branches and `unreachable`.
51
51
52
52
The typechecking algorithm is split between typechecking functions for each judgment-form.
53
53
*`typecheck-module` produces derivations of `⊢-module` for a given `mod`.
54
54
*`typecheck-table` produces derivations of `⊢-module-table` for a given context and `tab`.
55
55
*`memory-derivation` produces derivations of `⊢-module-memory` for a given context and `mem`.
56
56
*`typecheck-global` produces derivations of `⊢-module-global` for a given context and `glob`.
57
57
*`typecheck-func` produces derivations of `⊢-module-func` for a given context and `func`.
58
-
*`typecheck-ins` produces derivaitions of `⊢` for a given context, `e*`, and pre- and post-stacks.
58
+
*`typecheck-ins` produces derivations of `⊢` for a given context, `e*`, and pre- and post-stacks.
0 commit comments