update'
[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 Famous 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 (make-vector 4)
131 \end{lstlisting}
132 \end{block}
133
134 \begin{block}{Length determination}
135 \begin{lstlisting}
136 (define vector?
137 (syntax-parser #:literals (make-vector)
138 [#(e* ...)
139 (length (syntax->datum #'(e* ...)))]
140 [(make-vector n:num/value)
141 (syntax->datum #'n.evidence)]
142 [_ #false]))
143 \end{lstlisting}
144 \end{block}
145 \end{frame}
146
147 \begin{frame}
148 \frametitle{Implementation (3)}
149 Only vector examples given\\
150 Very complex examples
151 \end{frame}
152
153 \begin{frame}
154 \frametitle{Evidence}
155 \begin{itemize}
156 \item Portable to other languages with macro/templates
157 \item Increased binary size of $4\%$
158 \item Implemented only for some features
159 \pause%
160 \item No real downsides given
161 \end{itemize}
162 \end{frame}
163
164 % Shoulders of giants...: what previous research does this work build on? What
165 % are the key underlying theoretical ideas? Software infrastructure?
166 \begin{frame}
167 \frametitle{Shoulders of giants}
168 \begin{itemize}
169 \item Papers on macros
170 \item Language/feature documentation
171 \item Meta programming
172 \item\ldots
173 \end{itemize}
174 \end{frame}
175
176 % Writing: analyse the writing
177 \begin{frame}
178 \frametitle{Writing}
179 \begin{itemize}
180 \item Implementation is not trivial or elegant
181 \item Colors
182 \item Literature\ldots a lot of documentation
183 \item LISP like language knowledge
184 \item Implementation sections are late
185 \item Examples in not very popular functional language
186 \begin{itemize}
187 \item Racket: $740$
188 \item {LISP}: $2620$
189 \item Haskell: $2800$
190 \item\ldots
191 \end{itemize}
192 \end{itemize}
193 \end{frame}
194
195 % Discussion points: end with questions which you think should arise
196 \begin{frame}
197 \frametitle{Discussion points}
198 \begin{itemize}
199 \item There should be more elaboration on the implementation.
200 \item Is the addition really helpful or does it just produce more
201 obfuscated compiler errors.
202 \item Paper should have been written in a more famous language.
203 \end{itemize}
204 \end{frame}
205
206 \end{document}