Programmable Semantic Fragments: The Design and Implementation of typy
This paper introduces typy, a statically typed programming language embedded by reflection into Python. Rather than defining a monolithic semantics, typy features a fragmentary semantics, i.e. it delegates semantic control over each term, drawn from Python’s fixed syntax, to a contextually relevant user-defined semantic fragment. This fragment programmatically 1) typechecks the term, and 2) assigns dynamic meaning to the term by computing its translation to Python. We argue that this design is expressive with examples of fragments that express the static and dynamic semantics of 1) functional records; 2) a variation on JavaScript’s prototypal object system; 3) labeled sums (with nested pattern matching a la ML); and 4) typed foreign interfaces to Python and OpenCL. These semantic structures are, or would need to be, defined primitively in other languages. We further argue that this design is compositionally well- behaved. It sidesteps the problems of grammar composition and the expression problem by allowing different fragments to deterministically share a fixed syntax. Moreover, programs are semantically stable under fragment composition.
Mon 31 OctDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
15:40 - 17:20 | |||
15:40 30mTalk | Synthesizing Regular Expressions from Examples for Introductory Automata Assignments GPCE | ||
16:10 30mTalk | Programmable Semantic Fragments: The Design and Implementation of typy GPCE | ||
16:40 30mTalk | Delaying Decisions in Variable Concern Hierarchies GPCE Jörg Kienzle McGill University, Canada, Gunter Mussbacher McGill University, Omar Alam Trent University, Philippe Collet University of Nice | ||
17:10 15mTalk | Automatic Code Generation in Practice: Experiences with Embedded Robot Controllers GPCE |