diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-05 09:41:42 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-05 09:41:42 +0200 |
commit | 4e802fead6bbfbbe47ade30d5c792210e39c7b5d (patch) | |
tree | e2072f4b0595ceca629ce64bfc9c4ad8f16a432f /doc | |
parent | 3765e26fba68c8219b27fab9191ade7a845dddd7 (diff) |
improve ideas
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guide.pandoc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/doc/guide.pandoc b/doc/guide.pandoc index 9a4f8698..b4ba61bd 100644 --- a/doc/guide.pandoc +++ b/doc/guide.pandoc | |||
@@ -17,7 +17,7 @@ Additional tasks of the compiler: | |||
17 | - highlight errors | 17 | - highlight errors |
18 | - show inferred types in tooltips | 18 | - show inferred types in tooltips |
19 | - code completion during editing | 19 | - code completion during editing |
20 | - additional feedback for users | 20 | - additional feedback for programmers |
21 | - show desugared source | 21 | - show desugared source |
22 | - show optimizations | 22 | - show optimizations |
23 | 23 | ||
@@ -59,21 +59,21 @@ Example: Compilation and reduction of a simple value | |||
59 | Code generation by reduction | 59 | Code generation by reduction |
60 | ---------------------------- | 60 | ---------------------------- |
61 | 61 | ||
62 | The basic idea is that the compilation is done is multiple phases. | 62 | The interface between the compiler and the code generator is the builtin `Expression` type. |
63 | The compilation is done in multiple phases: | ||
63 | 64 | ||
64 | The code generator is compiled before its invocation. | 65 | 1. The code generator is in a library; it is parsed and normalized by the compiler. |
65 | 66 | 2. The application code is normalized by the compiler and it is given to the code generator as an `Expression` value. | |
66 | The interface between the compiler and the code generator is the reflected elaborated code. | ||
67 | 67 | ||
68 | Additinional design decisions: | 68 | Additinional design decisions: |
69 | 69 | ||
70 | - be able to pattern match on different normal forms of the reflected elaborated code | 70 | - include pattern synonyms which can match different normal forms of `Expression` |
71 | This eases the description of code generation. | 71 | This eases the description of code generation. |
72 | - Ideally no error handling is needed during code generation; all misues should prevented by the type system. | 72 | - Ideally no error handling is needed during code generation; all misues should ruled out during the type checking of application code. |
73 | - compilation stages are tracked by the type system | 73 | - track compilation stages by the type system [(reference)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.4374) |
74 | - prevents even more misuses | 74 | - prevents even more misuses |
75 | - help to speed up compilation? | 75 | - helps to speed up compilation (?) |
76 | - support different optimization transformations in the libraries | 76 | - include optimizing transformations of `Expression` in the libraries |
77 | 77 | ||
78 | 78 | ||
79 | ### Example: Compilation of domain specific code in two phases | 79 | ### Example: Compilation of domain specific code in two phases |
@@ -383,8 +383,6 @@ TypeAnn p t `matches` v = p `matches` v | |||
383 | 383 | ||
384 | 384 | ||
385 | 385 | ||
386 | |||
387 | |||
388 | #### View patterns | 386 | #### View patterns |
389 | 387 | ||
390 | 388 | ||