Slides from talk for Code Generation 2013 in Cambridge. Most of the presentation was a live demonstration and is not reflected in the slides. Slide 5 is the code that we ended up developing during the presentation.
5. module names rules // properties and variables
imports include/Cam Property(name, t, _):
defines Property name of type t
namespaces
Module Type Property Variable Function Var(name):
refers to Variable name
rules // modules refers to Property name
Module(name, _): VarDeclInit(name, t, _):
defines Module name defines Variable name of type t
scopes Type in subsequent scope
rules // entities and types VarDecl(name, t):
defines Variable name of type t
Entity(name, _, _, _):
defines Type name Arg(name, t):
scopes Type, Property, Function, Variable defines Variable name of type t
Type0(name): rules // functions and calls
refers to Type name
FunDef(name, arg*, t, _):
Type(name, _): defines Function name of type (t*, t)
refers to Type name scopes Variable
where arg* has type t*
TypeParam(name):
defines Type name FunDecl(name, arg*, t):
defines Function name of type (t*, t)
scopes Variable
where arg* has type t*
ThisCall(name, _):
refers to Function name
Name binding and scope MethCall(e, name, e*):
rules for Cam (toy) language refers to Function name in Type t_name
where e has type Type(t_name, _)
6. Name Binding Concepts
class
defines partial class
type
refers inheritance
namespaces
namespace
using
scopes
method
field
imports variable
parameter
block
7. Outlook
Language definition = CFG + NBD + TS + DS
Single source for
Language reference manual
Efficient (incremental) compiler
Execution engine (interpreter)
Integrated development environment
8. The Language Designer’s Workbench
NWO VICI 2012 grant: 1.5M Euro for 5 years
Declarative Language Definition
Syntax Name Type Dynamic
Transforms
Definition Binding System Semantics
Editor Correctness
Compiler Tests
(IDE) Proof
bridging the gap between language engineering and semantics engineering