diff options
Merge branch '2020/intro'
1 files changed, 66 insertions, 1 deletions
| -rw-r--r-- | website/content/slides/01_dragons/_index.md | 67 |
diff --git a/website/content/slides/01_dragons/_index.md b/website/content/slides/01_dragons/_index.md index 52ecf91..756066b 100644 --- a/website/content/slides/01_dragons/_index.md +++ b/website/content/slides/01_dragons/_index.md @@ -197,7 +197,26 @@ LR(n) and LALR(n) are family of parsing algorithms for CFG --- ###### AST -# TODO: use JavaScript AST dumper +https://esprima.org/demo/parse.html?code=function%20answer()%20%7B%0A%20%20%20%20return%206%20*%207%3B%0A%7D + + { + "type": "FunctionDeclaration", + "id": { "type": "Identifier", "name": "answer" }, + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "BinaryExpression", + "operator": "*", + "left": { "type": "Literal", "value": 6 }, + "right": { "type": "Literal", "value": 7 } + } + } + ] + }, + } --- ### Middle @@ -233,6 +252,37 @@ that is convenient for: } --- +### WebAssembly + +WebAssembly is actually an IR. + + (module + (func (export "add") (param $n1 i32) (param $n2 i32) (result i32) + get_local $n1 + get_local $n2 + i32.add + ) + ) + +--- +### .NET CIL + +- C#, F#, Basic (some versions), etc target the .NET virtual machine +- Common Intermediate Language + + .class public Foo + { + .method public static int32 Add(int32, int32) cil managed + { + .maxstack 2 + ldarg.0 // load the first argument; + ldarg.1 // load the second argument; + add // add them; + ret // return the result; + } + } + +--- ### Back end > Takes the IR and produces native code for a particular machine @@ -336,5 +386,20 @@ expressions. - antlr --- +### Crash course in JSImpl + +- repository organization +- continous integration +- pull requests + +--- +### Crash course in JSImpl + +- projects +- allocators +- tests + + +--- # ? --- |
