RISE & Shine: Language-Oriented Compiler Design

Michel Steuwer1 Thomas Kœhler2 Bastian Köpcke3 Federico Pizzuti1 Affiliation: 1University of Edinburgh, Scotland, UK 2University of Glasgow, Scotland, UK 3University of Münster, Germany
Email: michel.steuwer@ed.ac.uk, thomas.koehler@thok.eu, bastian.koepcke@wwu.de, federico.pizzuti@ed.ac.uk
Abstract
The trend towards specialization of software and hardware — fueled by the end of Moore’s law and the still accelerating interest in domain-specific computing, such as machine learning — forces us to radically rethink our compiler designs.

I Introduction

II Background in IR and Compiler Design

III Shine: A Language-Oriented Compiler

IV Clearly Separating Optimizing from Code Generation

One main principle observed in the Shine compiler is the clear separation of IRs for optimizing and code generation.

IV-A RISE expressions, types, and primitives

⬇ EE := x | 0.0f | variables and literals fun(x => EE) | function abstraction EE |> EE | EE(EE) | function application depFun(x: KK => EE) | dependent fun. abstraction EE(NN) | EE(D​TDT) | EE(AA) | dependent fun. application map | reduce | reduceSeq | zip | … primitives
Expr t: Type PrimitiveDepApply¡K,T¿ kind: K; f: Expr; x: T DepLambda¡K,I¿ kind: K; x: I; e: Expr Apply f: Expr; e: Expr Lambda x: Identifier; e: Expr Literal value: String Identifier name: String
Fig. 3: Grammar of RISE expressions (above) and corresponding diagram of classes (below) representing them.