Generating Safe Boundary APIs between Typed EDSLs and their Environments
Embedded domain specific languages (EDSLs) are used to represent special-purpose code in a general-purpose language and they are used for applications like vector calculations and run-time code generation. Often, code in an EDSL is compiled to a target (e.g. GPU languages, JVM bytecode, assembly, JavaScript) and needs to interface with other code that is available at that level but uses other data representations or calling conventions. We present an approach for safely making available such APIs in a typed EDSL, guaranteeing correct conversions between data representations and the respect for calling conventions. When the code being interfaced with is the result of static compilation of host language code, we propose a way to auto-generate the needed boilerplate using meta-programming. We instantiate our technique with JavaScript as the target language, JS-Scala as the EDSL, Scala.js as the static compiler and Scala macros to generate the boilerplate, but our design is more generally applicable. We provide evidence of usefulness of our approach through a prototype implementation that we have applied in a non-trivial code base.
Mon 26 OctDisplayed time zone: Eastern Time (US & Canada) change
10:30 - 12:00 | |||
10:30 10mDay opening | Opening Remarks GPCE | ||
10:40 30mTalk | Shallow Embedding of DSLs via Online Partial Evaluation GPCE Roland Leißa , Klaas Boesche Saarland University, Sebastian Hack , Richard Membarth German Research Center for Artificial Intelligence, Philipp Slusallek German Research Center for Artificial Intelligence | ||
11:10 30mTalk | Almost First-Class Language Embedding: Taming Staged Embedded DSLs GPCE | ||
11:40 20mTalk | Generating Safe Boundary APIs between Typed EDSLs and their Environments GPCE Bob Reynders iMinds - Distrinet, KU Leuven, Dominique Devriese iMinds - Distrinet, KU Leuven, Frank Piessens iMinds - Distrinet, KU Leuven |