-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalk.tex
202 lines (174 loc) · 5.52 KB
/
talk.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
% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: xelatex
% style inspired by
% https://github.com/omelkonian/presentations/blob/2c0b2e1f592a8f90797e4997c3ab8785b114f595/%5B2019.08.20%5D%20BitML%20(SRC%20Presentation%20@%20ICFP)/bitml-presentation.tex
\documentclass[aspectratio=169]{beamer}
\usetheme{metropolis}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb, bm}
\usepackage{tcolorbox}
\usepackage[makeroom]{cancel}
\usepackage{mathpartir}
\usepackage{xparse,minted}
\usepackage{csvsimple}
% figure support
\usepackage{import}
\usepackage{xifthen}
\usepackage{pdfpages}
\usepackage{transparent}
\newcommand{\incfig}[1]{%
\def\svgwidth{\columnwidth}
\import{./figures/}{#1.pdf_tex}
}
% style for tcolorboxes
\tcbset{plain/.style={colbacktitle=white,coltitle=black,colback=white}}
\pdfsuppresswarningpagegroup=1
% fonts
\usepackage{relsize}
\usepackage[tt=false]{libertine}
\usepackage[libertine]{newtxmath}
% colours
\definecolor{CTUBlue}{HTML}{007ac2}
\setbeamercolor{alerted text}{fg=CTUBlue}
\title{Haskell Dynamic Tracing}
\author{Ondřej Kvapil, supervised by Ing. Filip Křikava, PhD.}
\institute{Czech Technical University in Prague, Faculty of Information Technology}
\date{28th April, 2021}
\begin{document}
\begin{center}
\maketitle
\end{center}
%\begin{frame}{Outline}
% \begin{itemize}
% \item Introduction
% \item Goals of the thesis
% \item Motivation behind the choice of topic
% \item Technical terminology and acronyms
% \item Current state of the solution
% \item Solution of the problem (expected outcome)
% \item Conclusion -- a summary of the important points, contributions
% \item Thanks \& discussion
% \end{itemize}
%\end{frame}
\begin{frame}[fragile]{Introduction}
\begin{itemize}
\item<1-> Haskell is a \alert{lazy} language
\item<2-> Delays evaluation of an expression until its value is needed
\item<6-> Shares evaluated subexpressions
\end{itemize}
\begin{overprint}
\onslide<3-5>
\begin{minted}[autogobble]{haskell}
snd :: (Int, Int) -> Int
snd (x, y) = y
\end{minted}
\begin{overprint}
\onslide<4>
\begin{minted}[autogobble]{haskell}
foo :: Int
foo = snd (complexComputation, 3)
\end{minted}
\onslide<5>
\begin{minted}[autogobble]{haskell}
foo' :: Int
foo' = snd (error "oops!", 3)
\end{minted}
\end{overprint}
\onslide<7>
\begin{minted}[autogobble]{haskell}
let x = complexComputation
in f (x, x)
\end{minted}
\end{overprint}
\end{frame}
\begin{frame}{Goals}
\begin{itemize}
\item Key question: how is laziness used in practice? \pause
\item Develop a \alert{dynamic tracing} framework \pause
\item Tool capable of analysing real-world Haskell programs
\end{itemize}
\end{frame}
\begin{frame}{Motivation}
\begin{itemize}
\item Interesting landscape -- Haskell is heavily used in academia
\pause
\item Lack of empirical results despite extensive theoretical study
\pause
\item Laziness has advantages as well as significant downsides
\end{itemize}
\end{frame}
\begin{frame}{State-of-the-art}
\begin{itemize}
\item Unnecessary laziness leads to \alert{large memory overhead}
\pause
\item Some tools designed to avoid too much laziness
(\texttt{nothunks}, \texttt{BangPatterns}) \pause
\item Black-box problem: developers lack insight about the runtime
state
\end{itemize}
\end{frame}
\begin{frame}{Our solution}
\begin{itemize}
\item Compiler plugin for the \alert{Glasgow Haskell Compiler} \pause
\item Transforms surface syntax of Haskell to add tracing calls \pause
\item Traces evaluation of function calls and function arguments
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Our solution}
\begin{overprint}
\onslide<1>
\begin{minted}[autogobble]{haskell}
qsort [] = []
qsort (a:as) = qsort left ++ [a] ++ qsort right
where (left, right) = (filter (<=a) as, filter (>a) as)
main = print $ qsort [1 + 8, 4, 0, 3, 1, 23, 11, 18]
\end{minted}
\onslide<2>
\begin{minted}[autogobble]{haskell}
qsort (a : as) = let !call_number_1 = traceEntry "qsort"
in qsort left
++ [(traceArg "qsort") "a" call_number_1 a]
++ qsort right
where
(left, right) = let !call_number_2 = traceEntry "qsort"
in (filter
(<= (traceArg "qsort") "a" call_number_2 a)
(traceArg "qsort") "as" call_number_2 as,
filter
(> (traceArg "qsort") "a" call_number_2 a)
(traceArg "qsort") "as" call_number_2 as)
\end{minted}
\end{overprint}
\end{frame}
\begin{frame}{Our solution}
\csvautotabular{./resources/trace-slice-with-header.csv}
\end{frame}
\begin{frame}{Summary}
\begin{itemize}
\item Compile-time \alert{rewriting of programs} via a plugin for
the Glasgow Haskell Compiler \pause
\item Annotation with side-effecting tracing functions \pause
\item Compiled program records a trace of relevant events alongside
regular output
\end{itemize}
\end{frame}
\begin{frame}{}
Thank you for listening.
\bibliographystyle{./styles/iso690.bst}
\begin{thebibliography}{1}
\bibitem{thesis}
Kvapil, Ondřej.
\textit{Haskell Dynamic Tracing}.
Bachelor's thesis.
Czech Technical University in Prague,
Faculty of Information Technology, 2021.
\end{thebibliography}
\url{https://gitlab.fit.cvut.cz/kvapiond/bachelors-thesis}
\url{https://github.com/viluon/bachelors-thesis}
\end{frame}
\end{document}