Difference between revisions of "WG211/M12Rhiger"

From WG 2.11
Jump to: navigation, search
(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
+
can be constructed, composed, and executed dynamically at
runtime.
+
runtime.
  
We present a translation from a typed multi-stage source
+
We present a translation from a typed multi-stage source
language to multi-stage target code.  The source language is
+
language to multi-stage target code.  The source language is
high level: It represents variables (including variables in
+
high level: It represents variables (including variables in
code fragments) by their name.  The target code is low level:
+
code fragments) by their name.  The target code is low level:
It represents variables (including variables in code fragments)
+
It represents variables (including variables in code fragments)
by their memory location.
+
by their memory location.
  
This translation, therefore, is one step towards multi-stage
+
This translation, therefore, is one step towards multi-stage
languages that compile code fragments statically at compile
+
languages that compile code fragments statically at compile
time rather than dynamically at runtime.
+
time rather than dynamically at runtime.
  
The translation is based on a simple type system for
+
The translation is based on a simple type system for
multi-stage languages and an observation that the code type of
+
multi-stage languages and an observation that the code type of
this type system precisely characterizes the memory layout of
+
this type system precisely characterizes the memory layout of
code fragments.
+
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.