43106a16418e157c8b2583ccd175b35bf29714c0
[rsss1516.git] / long2 / slides.tex
1 \documentclass{beamer}
2
3 \usepackage{stmaryrd}
4 \usepackage{listings}
5
6 \title{Do you see what I see?}
7 \subtitle{\emph{Functional pearl} (2016)}
8 \author{M.~Lubbers}
9 \date{\today}
10
11 \lstset{%
12 basicstyle=\ttfamily\small
13 }
14
15 \begin{document}
16 \frame{\titlepage}
17 % Objective: what is the goal of this work, what problem is addressed, what was
18 % the current state of the art, who is the work aimed at?
19 \begin{frame}
20 \frametitle{About functional pearls\ldots}
21 \begin{itemize}
22 \item ICFP / Journal of Functional Programming
23 \item Elegance
24 \item Instructive
25 \item Fun
26 \item Editors
27 \begin{itemize}
28 \item Prof.\ Philip Wadler
29 \item \ldots
30 \pause%
31 \item Prof.\ Ralf Hinze
32 \end{itemize}
33 \end{itemize}
34 \end{frame}
35
36 \begin{frame}
37 \frametitle{Objective}
38 \begin{block}{Elaborate on the type system}
39 \pause%
40 \begin{itemize}
41 \item Racket programming language
42 \item Implemented as macro
43 \item No extra syntax or annotations
44 \item Syntactical/static analyses
45 \end{itemize}
46 \end{block}
47 \pause%
48 \begin{block}{Why?}
49 \pause%
50 \begin{itemize}
51 \item Pass typechecker? Correct program\ldots
52 \item Solve problems with arity(indexed)
53 \item Dependant types expensive
54 \end{itemize}
55 \end{block}
56 \end{frame}
57
58 % Proposal: if the paper presents a new idea, what, in a nutshell, is it?
59 \begin{frame}
60 \frametitle{Proposal (1)}
61 \begin{block}{Notation}
62 \texttt{$\llbracket$e$\rrbracket$}- Elaboration function on $e$\\
63 \end{block}
64 \pause%
65 \begin{block}{Curry example}
66 \begin{tabular}{rl}
67 \texttt{$\llbracket$ (curry ($\lambda$ (x y) x)) $\rrbracket$}
68 & \texttt{= (curry\_2 ($\lambda$ (x y) x))}\\
69 \pause%
70 \texttt{$\llbracket$ (curry ($\lambda$ (x y z) x)) $\rrbracket$}
71 & \texttt{= (curry\_3 ($\lambda$ (x y z) x))}\\
72 \pause%
73 \texttt{$\llbracket$ (curry ($\lambda$ (x y z a) x)) $\rrbracket$}
74 & \texttt{= (curry\_4 ($\lambda$ (x y z a) x))}\\
75 \pause%
76 &\ldots
77 \end{tabular}
78 \end{block}
79 \end{frame}
80
81 \begin{frame}
82 \frametitle{Proposal (2)}
83 \begin{block}{Printf type annotations}
84 \pause%
85 \texttt{$\llbracket$ (printf "{\textasciitilde}b" 2) $\rrbracket$}\\
86 \texttt{String Any * -> Void}\\\vspace{1em}
87 \pause%
88 \texttt{(printf "{\textasciitilde}b" (2:: Integer))}\\
89 \texttt{String Integer -> Void}
90 \end{block}
91 \end{frame}
92
93 \begin{frame}
94 \frametitle{Proposal (3)}
95 \begin{block}{And much more\ldots}
96 \begin{itemize}
97 \item Regular expressions
98 \item Database queries
99 \item Fixed size vectors
100 \item\ldots
101 \end{itemize}
102 \end{block}
103 \end{frame}
104
105 % Evidence: Support for claims - Theorems? Case studies? Simulations?
106 % Benchmarks? Does evidence address issues needed to support claims?
107 \begin{frame}[fragile]
108 \frametitle{Implementation (1)}
109 \begin{itemize}
110 \item Macros
111 \item Expanded recursively before computation
112 \item Syntax classes
113 \item
114 \begin{lstlisting}
115 (make-alias #'vector-length
116 (syntax-parser
117 [(_ v:vector/length)
118 #''v.evidence]
119 [_ #false]))
120 \end{lstlisting}
121 \end{itemize}
122 \end{frame}
123
124 \begin{frame}[fragile]
125 \frametitle{Implementation (2)}
126 \framesubtitle{Vector length}
127 \begin{block}{Vector notation racket}
128 \begin{lstlisting}
129 #(4 42 1 0)
130
131 (make-vector 4)
132 \end{lstlisting}
133 \end{block}
134
135 \begin{block}{Length determination}
136 \begin{lstlisting}
137 (define vector?
138 (syntax-parser #:literals (make-vector)
139 [#(e* ...)
140 (length (syntax->datum #'(e* ...)))]
141 [(make-vector n:num/value)
142 (syntax->datum #'n.evidence)]
143 [_ #false]))
144 \end{lstlisting}
145 \end{block}
146 \end{frame}
147
148 \begin{frame}
149 \frametitle{Evidence}
150 \begin{itemize}
151 \item Portable to other languages with macro/templates
152 \item Increased binary size of $4\%$
153 \item Implemented only for some features
154 \pause%
155 \item No real downsides given
156 \end{itemize}
157 \end{frame}
158
159 % Shoulders of giants...: what previous research does this work build on? What
160 % are the key underlying theoretical ideas? Software infrastructure?
161 \begin{frame}
162 \frametitle{Shoulders of giants}
163 \begin{itemize}
164 \item Papers on macros
165 \item Language/feature documentation
166 \item Meta programming
167 \item\ldots
168 \end{itemize}
169 \end{frame}
170
171 % Writing: analyse the writing
172 \begin{frame}
173 \frametitle{Writing}
174 \begin{itemize}
175 \item Implementation is not trivial or elegant
176 \item Colors
177 \item Literature\ldots a lot of documentation
178 \item LISP like language knowledge
179 \item Implementation sections are late
180 \item Examples in not very popular functional language
181 \begin{itemize}
182 \item Racket: $740$
183 \item {LISP}: $2620$
184 \item Haskell: $2800$
185 \item\ldots
186 \end{itemize}
187 \end{itemize}
188 \end{frame}
189
190 % Discussion points: end with questions which you think should arise
191 \begin{frame}
192 \frametitle{Discussion points}
193 \begin{itemize}
194 \item There should be more elaboration on the implementation.
195 \item Is the addition really helpful or does it just produce more
196 obfuscated compiler errors.
197 \item Paper should have been written in a more famous language.
198 \end{itemize}
199 \end{frame}
200
201 \end{document}