rfc:ast_based_parsing_compilation_process
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:ast_based_parsing_compilation_process [2012/09/07 12:54] – Add link regard functions parens nikic | rfc:ast_based_parsing_compilation_process [2013/08/24 19:13] – add ML discussion nikic | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
* Status: Under Discussion | * Status: Under Discussion | ||
+ | * [[http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 24: | Line 25: | ||
==== Elimination of various quirks ==== | ==== Elimination of various quirks ==== | ||
- | Currently there is various quirks in the emitted opcodes which can be attributed to the use of a single-pass compiler. Some examples: | + | Currently there are various quirks in the emitted opcodes which can be attributed to the use of a single-pass compiler. Some examples: |
* The NOP opcodes that are inserted in several places. (Yes, this point isn't particularly important) | * The NOP opcodes that are inserted in several places. (Yes, this point isn't particularly important) | ||
Line 40: | Line 41: | ||
==== Decoupling syntax decisions from technical issues ==== | ==== Decoupling syntax decisions from technical issues ==== | ||
- | With the current single-pass compiler some things are very hard / near impossible to implement. This actively influences syntax | + | With the current single-pass compiler some things are very hard / near impossible to implement. This actively influences syntax |
- | One example | + | A few examples |
- | Another example are list comprehensions / generator expressions where the result expression comes first (e.g. '' | + | * Array destructuring using something like '' |
+ | * List comprehensions / generator expressions where the result expression comes first, e.g. '' | ||
+ | * C#-style expression trees (which form the basis for LINQ) | ||
- | Those are two examples of larger limitations, but smaller syntax decisions | + | Apart from larger |
+ | |||
+ | ==== Better error messages ==== | ||
+ | |||
+ | Currently many things are directly enforced in the grammar which should really be checked during compilation (or a completely separate pass). E.g. if you try to initialize a class property with a non-static value, you'll get a rather unintelligible parse error message, instead of something like '' | ||
===== Disadvantages ===== | ===== Disadvantages ===== |
rfc/ast_based_parsing_compilation_process.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1