-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorbin-morevms18-typhon.tex
70 lines (49 loc) · 2 KB
/
corbin-morevms18-typhon.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
\documentclass[sigconf, 10pt]{acmart}
\usepackage{booktabs} % For formal tables
% Copyright
%\setcopyright{none}
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
\setcopyright{rightsretained}
%\setcopyright{usgov}
%\setcopyright{usgovmixed}
%\setcopyright{cagov}
%\setcopyright{cagovmixed}
%Conference
\acmConference{MoreVMs 2018}{April 2018}{Nice, France}
\copyrightyear{2018}
\begin{document}
\title{Basic Nanopass for RPython}
\author{Corbin Simpson}
\affiliation{%
\institution{Matador Cloud LLC}
\city{Portland}
\state{Oregon}
\country{USA}
}
\email{[email protected]}
\begin{abstract}
The nanopass~\cite{nanopass} style of compiler design eases the task of
maintaining data-transformation passes in compilers. However, nanopass
compilers require a metaprogramming framework which aids in the generation of
the boilerplate for those passes. The original nanopass toolchain is a Racket
module of over 2000 lines of code containing many Racket-specific features.
We present a Python 2 module for generating a nanopass compiler pipeline for
the RPython toolchain~\cite{Ancona:2007:RST:1297081.1297091}. Our approach
uses standard Python metaprogramming tactics to generate boilerplate RPython
classes. Users of our module write standard RPython, inheriting from our
classes and providing plain visitor methods.
The generated passes use features of the RPython type system to enforce a
modicum of correctness, preventing certain common programmer errors. Passes
also have utility methods for raising error contexts to the end user and
handling source span information.
Our module is about 200 lines of code. We developed and use our nanopass
module in the Typhon~\cite{typhon} compiler to optimize and interpret the
Monte programming language~\cite{monte}. Our source code is publically
available under a Free Software license at~\cite{typhonNanopass}.
\end{abstract}
\keywords{Monte, RPython, nanopass}
\bibliographystyle{ACM-Reference-Format}
\bibliography{corbin-morevms18-typhon}
\maketitle
\end{document}