Difference between revisions of "WG211/M12Rhiger"
(Created page with "''Towards static compilation of dynamic code generation'' by Morten Rhiger Multi-stage languages provide first-class code fragments that can be constructed, composed, and execu...") |
|||
Line 2: | Line 2: | ||
Multi-stage languages provide first-class code fragments that | Multi-stage languages provide first-class code fragments that | ||
− | + | can be constructed, composed, and executed dynamically at | |
− | + | runtime. | |
− | + | We present a translation from a typed multi-stage source | |
− | + | language to multi-stage target code. The source language is | |
− | + | high level: It represents variables (including variables in | |
− | + | code fragments) by their name. The target code is low level: | |
− | + | It represents variables (including variables in code fragments) | |
− | + | by their memory location. | |
− | + | This translation, therefore, is one step towards multi-stage | |
− | + | languages that compile code fragments statically at compile | |
− | + | time rather than dynamically at runtime. | |
− | + | The translation is based on a simple type system for | |
− | + | multi-stage languages and an observation that the code type of | |
− | + | this type system precisely characterizes the memory layout of | |
− | + | code fragments. |
Latest revision as of 19:12, 30 May 2013
Towards static compilation of dynamic code generation by Morten Rhiger
Multi-stage languages provide first-class code fragments that can be constructed, composed, and executed dynamically at runtime.
We present a translation from a typed multi-stage source language to multi-stage target code. The source language is high level: It represents variables (including variables in code fragments) by their name. The target code is low level: It represents variables (including variables in code fragments) by their memory location.
This translation, therefore, is one step towards multi-stage languages that compile code fragments statically at compile time rather than dynamically at runtime.
The translation is based on a simple type system for multi-stage languages and an observation that the code type of this type system precisely characterizes the memory layout of code fragments.