From 11a8bf61d685062661f1af1f82ed451c041120a5 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 21:43:56 +0300 Subject: Fix merged slides --- website/content/slides/00_intro/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/content/slides/00_intro/_index.md b/website/content/slides/00_intro/_index.md index 0625219..62b1491 100644 --- a/website/content/slides/00_intro/_index.md +++ b/website/content/slides/00_intro/_index.md @@ -133,6 +133,7 @@ contribution. - Follow the pull request template - Add your faculty number in the description +--- ## What are the requirements? -- cgit v1.3.1-26-gb76a From b7e2abe3b90fc08ccbeb857b760b059f8a43c0a8 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 21:44:39 +0300 Subject: Remove slide fragments as they are unreadble --- website/content/slides/00_intro/_index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/content/slides/00_intro/_index.md b/website/content/slides/00_intro/_index.md index 62b1491..f05cb44 100644 --- a/website/content/slides/00_intro/_index.md +++ b/website/content/slides/00_intro/_index.md @@ -137,12 +137,12 @@ contribution. ## What are the requirements? -1. {{< frag c="Will to learn and time to experiment and write code" >}} -2. {{< frag c="Programming with C++, fluent in C++ will be better" >}} -2. {{< frag c="Programming with JavaScript or other dynamic language" >}} -3. {{< frag c="Data structures" >}} -4. {{< frag c="Languages, Finite Automata, Computability" >}} -5. {{< frag c="How computers work - CPU, memory hierarchy, etc" >}} +1. Will to learn and time to experiment and write code +2. Programming with C++, fluent in C++ will be better +2. Programming with JavaScript or other dynamic language +3. Data structures +4. Languages, Finite Automata, Computability +5. How computers work - CPU, memory hierarchy, etc --- # Contents of the course -- cgit v1.3.1-26-gb76a From 37024b4f79832dbbddaf25a99367def781ece2b0 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 21:45:37 +0300 Subject: Add a timeline plan for the course --- website/content/slides/00_intro/_index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/content/slides/00_intro/_index.md b/website/content/slides/00_intro/_index.md index f05cb44..623521e 100644 --- a/website/content/slides/00_intro/_index.md +++ b/website/content/slides/00_intro/_index.md @@ -228,6 +228,18 @@ Garbage collection 2. Just in Time 3. Ahead of Time +--- +# Plan for the course + +1. Introduction - week 1 +2. Lexers - week 2 +3. Parser - week 2 +4. AST - week 3, 4 +5. Bytecode - weeks 5, 6 +6. VMs - weeks 7, 8, 10 +7. GC - weeks 10, 11 +8. JIT & AOT code generation - weeks 11, 12, 13 + --- ## Resources -- cgit v1.3.1-26-gb76a From 59fd41dc941aec6e90ed75de4b5c1eaf1b967fc4 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 21:46:49 +0300 Subject: Elaborate on AST and VM topics --- website/content/slides/00_intro/_index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/content/slides/00_intro/_index.md b/website/content/slides/00_intro/_index.md index 623521e..79dd35f 100644 --- a/website/content/slides/00_intro/_index.md +++ b/website/content/slides/00_intro/_index.md @@ -183,6 +183,7 @@ Abstract Syntax Tree 1. How to grow one? 2. What to do with it? 3. Evaluating the syntax tree +4. Transforming the syntax tree {{% note %}} - language transformation at syntax level @@ -206,6 +207,7 @@ Virtual machines 1. What is a virtual machine? 2. Implementing the language features in the VM + - Library - arrays, hash maps, etc - OOP - Exception handling -- cgit v1.3.1-26-gb76a From 26e1314c7ab843987ac0eb28deb96e708b2e943f Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 21:49:05 +0300 Subject: Add AST for simple JavaScript function --- website/content/slides/01_dragons/_index.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/website/content/slides/01_dragons/_index.md b/website/content/slides/01_dragons/_index.md index 52ecf91..7892a65 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 -- cgit v1.3.1-26-gb76a From 8a88c9cec6ce15a0fc156ce5d13236f9665077db Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 22:10:34 +0300 Subject: Add real VM implementations as resources --- website/content/slides/00_intro/_index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/content/slides/00_intro/_index.md b/website/content/slides/00_intro/_index.md index 79dd35f..9341dfb 100644 --- a/website/content/slides/00_intro/_index.md +++ b/website/content/slides/00_intro/_index.md @@ -65,6 +65,7 @@ We are going to study and enhance a JavaScript interpreter. - understandable - working - extensible +- embeddable --- ## How you are going to be graded? @@ -210,6 +211,7 @@ Virtual machines - Library - arrays, hash maps, etc - OOP - Exception handling +3. Communicating with the "real" machine --- ## 7. GC @@ -251,5 +253,15 @@ Garbage collection - Links to resources will be there too! +--- +## Resources + +Real world virtual machines: + +- V8, SpiderMonkey, JavaScriptCore, ChakraCore and many more +- duktape +- lua, luajit +- cPython, PyPy, ... + --- # ? -- cgit v1.3.1-26-gb76a From 9d8e17488decc9b383ee73dff3e054cfc428e9d5 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 22:10:48 +0300 Subject: Add more IR samples --- website/content/slides/01_dragons/_index.md | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/website/content/slides/01_dragons/_index.md b/website/content/slides/01_dragons/_index.md index 7892a65..916c25a 100644 --- a/website/content/slides/01_dragons/_index.md +++ b/website/content/slides/01_dragons/_index.md @@ -251,6 +251,37 @@ that is convenient for: ret i32 %tmp2 } +--- +### 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 -- cgit v1.3.1-26-gb76a From 23d49d564e47172b626453e02e061ab65a3f1bf9 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 22:11:18 +0300 Subject: Add crash course in JSImpl to the intro --- website/content/slides/01_dragons/_index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website/content/slides/01_dragons/_index.md b/website/content/slides/01_dragons/_index.md index 916c25a..756066b 100644 --- a/website/content/slides/01_dragons/_index.md +++ b/website/content/slides/01_dragons/_index.md @@ -385,6 +385,21 @@ expressions. - lemon - antlr +--- +### Crash course in JSImpl + +- repository organization +- continous integration +- pull requests + +--- +### Crash course in JSImpl + +- projects +- allocators +- tests + + --- # ? --- -- cgit v1.3.1-26-gb76a From c781a237693c71ef67e46b4366ac939abc867006 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 23:10:24 +0300 Subject: Expire old content and remove the menu entry --- website/content/post/2018/midterm.md | 1 + website/content/post/2018/midterm_results.md | 1 + website/content/post/2018/project_presentation.md | 1 + website/content/post/2018/projects.md | 1 + website/content/post/2018/september.md | 1 + website/content/post/contents.md | 3 ++- website/content/post/homeworks.md | 3 ++- website/content/post/resources.md | 4 +++- website/data/menu.yaml | 2 -- 9 files changed, 12 insertions(+), 5 deletions(-) diff --git a/website/content/post/2018/midterm.md b/website/content/post/2018/midterm.md index 879a1f6..f29a375 100644 --- a/website/content/post/2018/midterm.md +++ b/website/content/post/2018/midterm.md @@ -2,6 +2,7 @@ title: "Midterm Test 2018 edition" date: 2018-12-08T19:01:49+02:00 edition: 2018 +expiryDate: 2020-09-30 draft: false --- # diff --git a/website/content/post/2018/midterm_results.md b/website/content/post/2018/midterm_results.md index 64050e2..1d78e8e 100644 --- a/website/content/post/2018/midterm_results.md +++ b/website/content/post/2018/midterm_results.md @@ -2,6 +2,7 @@ title: "Midterm Test Results - 2018 edition" date: 2019-01-08T19:01:49+02:00 edition: 2018 +expiryDate: 2020-09-30 draft: false --- diff --git a/website/content/post/2018/project_presentation.md b/website/content/post/2018/project_presentation.md index 7325bc4..d8b4c94 100644 --- a/website/content/post/2018/project_presentation.md +++ b/website/content/post/2018/project_presentation.md @@ -2,6 +2,7 @@ title: "Project Presentations - 2018 edition" date: 2019-01-25T19:01:49+02:00 edition: 2018 +expiryDate: 2020-09-30 draft: false --- diff --git a/website/content/post/2018/projects.md b/website/content/post/2018/projects.md index 6fa6fa1..5499cde 100644 --- a/website/content/post/2018/projects.md +++ b/website/content/post/2018/projects.md @@ -2,6 +2,7 @@ title: "Projects - 2018 edition" date: 2019-01-09T19:01:49+02:00 edition: 2018 +expiryDate: 2020-09-30 draft: false --- diff --git a/website/content/post/2018/september.md b/website/content/post/2018/september.md index a881d3e..97b5d60 100644 --- a/website/content/post/2018/september.md +++ b/website/content/post/2018/september.md @@ -2,6 +2,7 @@ title: "September Session Exam 2018 edition" date: 2019-08-22T19:01:49+02:00 edition: 2018 +expiryDate: 2020-09-30 draft: false --- diff --git a/website/content/post/contents.md b/website/content/post/contents.md index cf5d446..cbdaf00 100644 --- a/website/content/post/contents.md +++ b/website/content/post/contents.md @@ -1,8 +1,9 @@ --- title: "Course Contents" date: 2018-08-02T17:45:53+03:00 -edition: 2018 draft: false +expiryDate: 2020-09-30 + --- Table of contents for the course. diff --git a/website/content/post/homeworks.md b/website/content/post/homeworks.md index a1fb2ab..18627e7 100644 --- a/website/content/post/homeworks.md +++ b/website/content/post/homeworks.md @@ -2,7 +2,8 @@ title: "Homeworks" date: 2018-11-17T19:01:49+02:00 draft: false -edition: 2018 +expiryDate: 2020-09-30 + --- # Virtual Machine and JSImpl related homeworks diff --git a/website/content/post/resources.md b/website/content/post/resources.md index 4072002..cee1d64 100644 --- a/website/content/post/resources.md +++ b/website/content/post/resources.md @@ -1,8 +1,9 @@ --- title: "Resources" date: 2018-09-29T00:24:06+03:00 -edition: 2018 draft: false +expiryDate: 2020-09-30 + --- A general collection of resources on implementing programming languages and @@ -10,6 +11,7 @@ virtual machines. + ## General ### Courses diff --git a/website/data/menu.yaml b/website/data/menu.yaml index 2310032..ad8bb51 100644 --- a/website/data/menu.yaml +++ b/website/data/menu.yaml @@ -1,6 +1,4 @@ - name: Home link: "" -- name: 2018 - link: edition/2018/ - name: About link: about/ -- cgit v1.3.1-26-gb76a From 8068eca1b665e6d15d79fdee96263ce85aa4db56 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Mon, 5 Oct 2020 23:11:09 +0300 Subject: Add posts for the introductory lectures --- website/content/post/dragons.md | 15 +++++++++++++++ website/content/post/intro.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 website/content/post/dragons.md create mode 100644 website/content/post/intro.md diff --git a/website/content/post/dragons.md b/website/content/post/dragons.md new file mode 100644 index 0000000..937885b --- /dev/null +++ b/website/content/post/dragons.md @@ -0,0 +1,15 @@ +--- +title: "Programming Languages, Compilers, Interpreters" +date: 2020-10-05 +draft: false +--- + +Overview of compiler and interpreter architecture. + + + +[Slideshow]({{< ref "/slides/01_dragons" >}}) + +--- + +{{% readpost file="/slides/01_dragons/_index.md" markdown=true %}} diff --git a/website/content/post/intro.md b/website/content/post/intro.md new file mode 100644 index 0000000..06c5fe6 --- /dev/null +++ b/website/content/post/intro.md @@ -0,0 +1,15 @@ +--- +title: "Introduction to IPL course" +date: 2020-10-04 +draft: false +--- + +Introduction to the Implementation of Programming Languages course + + + +[Slideshow]({{< ref "/slides/00_intro" >}}) + +--- + +{{% readpost file="/slides/00_intro/_index.md" markdown=true %}} -- cgit v1.3.1-26-gb76a