-
Notifications
You must be signed in to change notification settings - Fork 0
/
thesis.tex
259 lines (228 loc) · 6.99 KB
/
thesis.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
\documentclass[10pt, a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{eso-pic} % \AddToShipoutPicture
\usepackage{graphicx} % \includegraphics
\usepackage{listings} % \includegraphics
\usepackage{pgfplots}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{mdframed}
\usepackage{float}
\usepackage{amsmath}
\usepackage{flafter}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{blindtext}
\usepackage{pgfplots}
\usepackage{seqsplit}
\usepackage[cache=false]{minted}
\usepackage{listings}
\usepackage[htt]{hyphenat}
\usepackage{amsmath,amssymb,amsbsy}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsbsy}
\usepackage{stmaryrd}
\usepackage{semantic}
\usepackage{url}
\usepackage{color}
\usepackage{flushend}
\usepackage{subfigure}
\usepackage{tikz}
\usepackage{svg}
\usepackage{pdfpages}
\usepackage{titling}
\usepackage{cleveref}
\usepackage[parfill]{parskip}
\usepackage[toc,page]{appendix}
%%% \usepackage{fontspec}
%%% \usepackage{titlesec}
%%% \setmainfont[
%%% BoldFont={Minion Pro Bold},
%%% ItalicFont={Minion Pro Italic},
%%% BoldItalicFont={Minion Pro Bold Italic},
%%% ]{Linux Libertine O}
%%% \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
%%%
%%% \setmonofont{FreeMono}
%%%
%%% \titleformat{\chapter}[display]
%%% {\normalfont\fontsize{12}{15}\bfseries}
%%% {\thesection}
%%% {1em}
%%% {}
%%% \titlelabel{\thetitle.\quad}
%%%
\newcommand{\fshark}{{\texttt{FShark}}}
\newcommand{\fsharp}{{\texttt{F\#}}}
\newcommand{\csharp}{{\texttt{C\#}}}
\newcommand{\clang}{{\texttt{C}}}
\newcommand{\Python}{{\texttt{Python}}}
\newcommand{\fsharpexpr}{\texttt{FSharpExpr}}
\newcommand{\fsharkexpr}{\texttt{FSharkExpr}}
\newcommand{\fsharkil}{\texttt{FSharkIL}}
\newcommand{\fsharkcompiler}{\texttt{FSharkCompiler}}
\newcommand{\fsharkwrapper}{\texttt{FShark Wrapper}}
\newenvironment{longlisting}{\captionsetup{type=listing}}{}
\setminted{fontsize=\small,baselinestretch=1,frame=lines,framerule=0.3pt,linenos}
\lstset{basicstyle=\small,frame=lines,numbers=left}
\usepackage[english, science, titlepage]{ku-frontpage}
\title{FShark}
\assignment{Master's thesis}
\author{Mikkel Storgaard Knudsen}
\subtitle{Futhark programming in FSharp}
\date{Handed in: \today{}}
\advisor{Advisor: Cosmin Eugen Oancea \\
Co-advisor: Troels Henriksen}
\frontpageimage{hedgehogshark_cropped.jpg}
\author{Mikkel Storgaard Knudsen}
\usepackage{tcolorbox}
\usepackage{etoolbox}
%\BeforeBeginEnvironment{minted}{\begin{tcolorbox}}%
%\AfterEndEnvironment{minted}{\end{tcolorbox}}%
% Futhark syntax highlighting setup
\usepackage{listings}
\renewcommand{\ttdefault}{pcr} % Courier instead of Computer Modern
% Fix dashes in listings (from
% https://tex.stackexchange.com/questions/33185/listings-package-changes-hyphens-to-minus-signs
% )
\makeatletter
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
\@empty\z@\@empty
\makeatother
\lstdefinelanguage{Futhark}
{keywords={fun,if,then,else,loop,do,map,reduce,reduceComm,filter,scan,redomap,redomapComm,transpose,reshape,iota,replicate,let,in,for,while,with,f32,int,zip,streamSeq,zipWith,unsafe,streamRed,streamMap,mapPerThread,fn,reduceKernel,concat,split,size},%
sensitive=true,
comment=[l]{--},
moredelim=**[is][\color{blue}]{$}{$}
}
\lstdefinelanguage{tail}
{keywords={let,in},%
sensitive=true,
comment=[l]{--},
moredelim=**[is][\color{blue}]{$}{$}
}
\lstset{
language=Futhark,
basicstyle=\ttfamily,
keywordstyle=\bfseries,
showlines=true,
columns=fullflexible,
keepspaces=true,
}
% for adjustwidth environment
\usepackage[strict]{changepage}
\setlength{\abovecaptionskip}{3pt plus 0pt minus 2pt} % Chosen fairly arbitrarily
% for formal definitions
\usepackage{framed}
% environment derived from framed.sty: see leftbar environment definition
\definecolor{formalshade}{rgb}{0.95,0.95,1}
\newenvironment{formal}{%
\def\FrameCommand{%
\hspace{1pt}%
{\color{formalshade}\vrule width 4pt}%
\colorbox{formalshade}%
}%
\MakeFramed{\advance\hsize-\width\FrameRestore}%
\noindent\hspace{-4.55pt}% disable indenting first paragraph
\begin{adjustwidth}{}{7pt}%
\vspace{2pt}\vspace{2pt}%
}
{%
\vspace{2pt}\end{adjustwidth}\endMakeFramed%
}
\newcommand{\evals}[1]{\llbracket #1 \rrbracket}
\newcommand{\evalfn}[1]{\evals{#1}_{\textrm{fn}}}
\newcommand{\evalbinop}[1]{\evals{#1}_{\textrm{binop}}}
\newcommand{\evalunop}[1]{\evals{#1}_{\textrm{unop}}}
\newcommand{\id}[1]{\emph{#1}}
\newcommand{\lit}[1]{\text{\ttfamily #1}} % literal
\definecolor{rosso}{RGB}{220,57,18}
\definecolor{giallo}{RGB}{255,153,0}
\definecolor{blu}{RGB}{102,140,217}
\definecolor{verde}{RGB}{16,150,24}
\definecolor{viola}{RGB}{153,0,153}
\makeatletter
\tikzstyle{chart}=[
legend label/.style={font={\scriptsize},anchor=west,align=left},
legend box/.style={rectangle, draw, minimum size=5pt},
axis/.style={black,semithick,->},
axis label/.style={anchor=east,font={\tiny}},
]
\tikzstyle{bar chart}=[
chart,
bar width/.code={
\pgfmathparse{##1/2}
\global\let\bar@w\pgfmathresult
},
bar/.style={very thick, draw=white},
bar label/.style={font={\bf\small},anchor=north},
bar value/.style={font={\footnotesize}},
bar width=.75,
]
\tikzstyle{pie chart}=[
chart,
slice/.style={line cap=round, line join=round, very thick,draw=white},
pie title/.style={font={\bf}},
slice type/.style 2 args={
##1/.style={fill=##2},
values of ##1/.style={}
}
]
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\newcommand{\pie}[3][]{
\begin{scope}[#1]
\pgfmathsetmacro{\curA}{90}
\pgfmathsetmacro{\r}{1}
\def\c{(0,0)}
\node[pie title] at (90:1.3) {#2};
\foreach \v/\s in{#3}{
\pgfmathsetmacro{\deltaA}{\v/100*360}
\pgfmathsetmacro{\nextA}{\curA + \deltaA}
\pgfmathsetmacro{\midA}{(\curA+\nextA)/2}
\path[slice,\s] \c
-- +(\curA:\r)
arc (\curA:\nextA:\r)
-- cycle;
\pgfmathsetmacro{\d}{max((\deltaA * -(.5/50) + 1) , .5)}
\begin{pgfonlayer}{foreground}
\path \c -- node[pos=\d,pie values,values of \s]{$\v\%$} +(\midA:\r);
\end{pgfonlayer}
\global\let\curA\nextA
}
\end{scope}
}
\newcommand{\legend}[2][]{
\begin{scope}[#1]
\path
\foreach \n/\s in {#2}
{
++(0,-10pt) node[\s,legend box] {} +(5pt,0) node[legend label] {\n}
}
;
\end{scope}
}
\begin{document}
%%%% CHAPTERS
\include{chapters/0_prelude}
\include{chapters/1_introduction}
\include{chapters/2_background}
\include{chapters/2half_architecture}
\include{chapters/5_csharpgenerator}
\include{chapters/3_fsharklang}
\include{chapters/4_fshark_compiler}
\include{chapters/7_limitations}
\include{chapters/6_evaluation}
\include{chapters/11_conclusion}
%\bibliographystyle{ACM-Reference-Format}
%\softraggedright
\bibliographystyle{abbrv}
\bibliography{report/references.bib}
\include{chapters/appendices}
\end{document}
%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-command-extra-options: "-shell-escape"
%%% End: