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/04 19:49] – 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. | + | Currently there are various quirks in the emitted opcodes which can be attributed to the use of a single-pass compiler. |
- | A more interesting example is the fact that whenever you access a static | + | * The NOP opcodes |
- | unnecessary CV for it. | + | * Access of static |
- | + | | |
- | Other quirks (which actually influences the behavior) is caused by the separation of '' | + | |
- | and '' | + | |
All these can be eliminated when an AST is used. | All these can be eliminated when an AST is used. | ||
Line 42: | 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 |
+ | |||
+ | A few examples of syntax that is currently not possible, but would be possible with a syntax tree: | ||
+ | |||
+ | * 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) | ||
- | One example | + | Apart from larger syntax limitations the current system commonly also affects smaller syntax decisions. |
- | Another example are list comprehensions / generator expressions where the result expression comes first (e.g. '' | + | ==== Better error messages ==== |
- | Those are two examples of larger limitations, | + | Currently |
===== Disadvantages ===== | ===== Disadvantages ===== |
rfc/ast_based_parsing_compilation_process.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1