Changeset 26
- Timestamp:
- Nov 23, 2007, 11:35:38 AM (18 years ago)
- Author:
- ats
- Message:
-
Reorganise a bit.
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
docs/trunk/200711-tock-seminars/200711-tock-slides.tex
r25 r26 122 122 123 123 \begin{frame} 124 (追記) \frametitle{What we're assuming you know} (追記ここまで) 125 (追記) \begin{itemize} (追記ここまで) 126 (追記) \item Monads (追記ここまで) 127 (追記) \end{itemize} (追記ここまで) 128 (追記) \end{frame} (追記ここまで) 129 (追記) (追記ここまで) 130 (追記) \begin{frame} (追記ここまで) 124 131 \frametitle{What is Tock?} 125 132 \begin{itemize} … … 131 138 \item Uses nanopass architecture 132 139 \item Implemented in Haskell 140 (追記) \end{itemize} (追記ここまで) 141 (追記) \end{frame} (追記ここまで) 142 (追記) (追記ここまで) 143 (追記) \begin{frame} (追記ここまで) 144 (追記) \frametitle{A brief history of Tock} (追記ここまで) 145 (追記) \begin{itemize} (追記ここまで) 146 (追記) \item In 2007, it was becoming increasingly clear that we needed (追記ここまで) 147 (追記) a new occam compiler\ldots (追記ここまで) 148 (追記) \item Adam wrote the initial \occam-to-C Tock (追記ここまで) 149 (追記) \begin{itemize} (追記ここまで) 150 (追記) \item Based on FCO ``spike solution'' compiler (追記ここまで) 151 (追記) \item Ideas from Matt, Christian and Damian's ``42'' (追記ここまで) 152 (追記) nanopass compiler (追記ここまで) 153 (追記) \end{itemize} (追記ここまで) 154 (追記) \item Neil joined the project to add support for Rain and C++ (追記ここまで) 155 (追記) \begin{itemize} (追記ここまで) 156 (追記) \item and has done most of the work since then! (追記ここまで) 157 (追記) \end{itemize} (追記ここまで) 133 158 \end{itemize} 134 159 \end{frame} … … 183 208 \frametitle{Nanopass compilation} 184 209 \begin{itemize} 185 \item Many small passes, each doing one thing 186 \item Passes can be: 187 \begin{itemize} 188 \item checks 189 \item annotations 190 \item transformations 191 \end{itemize} 210 \item Parse source into abstract syntax tree 211 \item Many small passes, each doing one thing to the AST 212 \begin{itemize} 213 \item Transformations, annotations, checks\ldots 214 \item Simple $\rightarrow$ easy to write and test 215 \item Easy to add new passes 216 \end{itemize} 217 \item Final AST is the output from the compiler 218 \end{itemize} 192 219 %FIXME: picture 193 (削除) %FIXME: code gen isn't really separate pass -- could rename to "output"? (削除ここまで)194 (削除) \end{itemize} (削除ここまで)195 (削除) \end{frame} (削除ここまで)196 (削除) (削除ここまで)197 (削除) \begin{frame} (削除ここまで)198 (削除) \frametitle{Nanopass compilation} (削除ここまで)199 (削除) \begin{itemize} (削除ここまで)200 (削除) \item Parse source into abstract syntax tree (削除ここまで)201 (削除) \item Each pass operates on the AST (削除ここまで)202 (削除) \begin{itemize} (削除ここまで)203 (削除) \item Passes are almost AST $\rightarrow$ AST functions (削除ここまで)204 (削除) \end{itemize} (削除ここまで)205 (削除) \item Emit final AST as generated code (削除ここまで)206 (削除) %FIXME: picture (削除ここまで)207 (削除) %FIXME: this feels like a duplicate of the previous slide (削除ここまで)208 (削除) \end{itemize} (削除ここまで)209 (削除) \end{frame} (削除ここまで)210 (削除) (削除ここまで)211 (削除) \begin{frame} (削除ここまで)212 (削除) \frametitle{Why nanopass?} (削除ここまで)213 (削除) \begin{itemize} (削除ここまで)214 (削除) \item 42 -- Matt, Christian and Damian's experimental Scheme (削除ここまで)215 (削除) \occam~compiler (削除ここまで)216 (削除) \begin{itemize} (削除ここまで)217 (削除) \item Based on ideas from nanopass course (削除ここまで)218 (削除) \end{itemize} (削除ここまで)219 (削除) \item Clean, well-structured (削除ここまで)220 (削除) \item Easy to extend (削除ここまで)221 (削除) \item Can apply same approach to usage checking (削除ここまで)222 (削除) \end{itemize} (削除ここまで)223 220 \end{frame} 224 221 … … 226 223 \frametitle{Why Haskell?} 227 224 \begin{itemize} 228 (削除) \item 42 didn't have a parser; occ21 has a hand-coded parser (削除ここまで)229 225 \item Haskell has a really good parser library (Parsec) 230 226 \item Other ideas from 42 looked transferable 231 227 \item Lots of Haskell expertise at Kent 232 228 \item Lots of existing compilers in Haskell 233 (削除) \end{itemize} (削除ここまで)234 (削除) \end{frame} (削除ここまで)235 (削除) (削除ここまで)236 (削除) \begin{frame} (削除ここまで)237 (削除) \frametitle{FCO -- 2006} (削除ここまで)238 (削除) \begin{itemize} (削除ここまで)239 (削除) \item A ``spike solution'' -- proof of concept (削除ここまで)240 (削除) \item Ideas liberally stolen from 42, occ21, nocc, occamdoc, (削除ここまで)241 (削除) etc. (削除ここまで)242 (削除) \item Compiled tiny subet of occam to C (削除ここまで)243 (削除) \item Experimented with various ways to implement nanopass (削除ここまで)244 (削除) architecture in Haskell (削除ここまで)245 (削除) \end{itemize} (削除ここまで)246 (削除) \end{frame} (削除ここまで)247 (削除) (削除ここまで)248 (削除) \begin{frame} (削除ここまで)249 (削除) \frametitle{Tock -- 2007} (削除ここまで)250 (削除) \begin{itemize} (削除ここまで)251 (削除) \item In 2007, it was becoming increasingly clear that we needed (削除ここまで)252 (削除) a new occam compiler\ldots (削除ここまで)253 (削除) \item Adam wrote the initial \occam-to-C Tock, based on the (削除ここまで)254 (削除) ideas from FCO (削除ここまで)255 (削除) \item Neil joined the project to add support for Rain and C++ (削除ここまで)256 (削除) \begin{itemize} (削除ここまで)257 (削除) \item and has done most of the work since then! (削除ここまで)258 (削除) \end{itemize} (削除ここまで)259 229 \end{itemize} 260 230 \end{frame} … … 773 743 %}}} 774 744 775 (削除) %{{{ monads (削除ここまで)776 (削除) %FIXME: kill this section (削除ここまで)777 (削除) \section{Monads} (削除ここまで)778 (削除) (削除ここまで)779 (削除) \begin{frame} (削除ここまで)780 (削除) \frametitle{Monads} (削除ここまで)781 (削除) \begin{itemize} (削除ここまで)782 (削除) \item A way of ordering operations with side-effects in a functional program (削除ここまで)783 (削除) \end{itemize} (削除ここまで)784 (削除) %FIXME: picture -- but we'll probably nuke this section anyway (削除ここまで)785 (削除) \end{frame} (削除ここまで)786 (削除) (削除ここまで)787 (削除) \begin{frame} (削除ここまで)788 (削除) \frametitle{Some useful monads} (削除ここまで)789 (削除) \begin{itemize} (削除ここまで)790 (削除) \item \lstinline|IO|: dealing with the real world (削除ここまで)791 (削除) \item \lstinline|State|: persistent state which can be changed (削除ここまで)792 (削除) \item \lstinline|Error|: any operation can throw an exception, short-circuiting the evaluation (削除ここまで)793 (削除) \item \lstinline|Parser|: operations can consume tokens and backtrack upon failure (削除ここまで)794 (削除) \end{itemize} (削除ここまで)795 (削除) \end{frame} (削除ここまで)796 (削除) (削除ここまで)797 (削除) \begin{frame}[fragile] (削除ここまで)798 (削除) \frametitle{Monads in disguise} (削除ここまで)799 (削除) \begin{itemize} (削除ここまで)800 (削除) \item Monads can be composed using monad transformers (削除ここまで)801 (削除) \item Our main monad composes the \lstinline|Error|, (削除ここまで)802 (削除) \lstinline|State| and \lstinline|IO| monads (削除ここまで)803 (削除) \begin{itemize} (削除ここまで)804 (削除) \item Many other variations throughout Tock (削除ここまで)805 (削除) \end{itemize} (削除ここまで)806 (削除) \end{itemize} (削除ここまで)807 (削除) \begin{lstlisting} (削除ここまで)808 (削除) type PassM = ErrorT ErrorReport (StateT CompilerState IO) (削除ここまで)809 (削除) type CodeGenM = WriterT [String] PassM (削除ここまで)810 (削除) \end{lstlisting} (削除ここまで)811 (削除) \end{frame} (削除ここまで)812 (削除) %}}} (削除ここまで)813 (削除) (削除ここまで)814 745 %{{{ parsing 815 746 \section{Parsing} … … 922 853 \end{frame} 923 854 924 %FIXME: flesh out this section 855 %FIXME: multipass checking 856 %FIXME: flesh out this section -- could merge into CFG bit? 925 857 %}}} 926 858 … … 962 894 \item Must support recursion 963 895 \begin{itemize} 964 \item e.g. \lstinline|genWhile| -> 965 \lstinline|genProcess| -> \lstinline|cppGenCall| 966 %Note: don't want the above -> arrows to be highlighted as 967 %if they were Haskell code! 896 \item \lstinline|genWhile| calls 897 \lstinline|genProcess|, which calls 898 \lstinline|cppGenCall| 968 899 \end{itemize} 969 900 \item Use "virtual function tables" … … 1183 1114 \begin{frame} 1184 1115 \frametitle{How we use Haskell} 1185 \begin{itemize} 1186 \item Tock is a \emph{practical} system 1187 \item Monads, monads, monads 1188 \begin{itemize} 1189 \item Not a lot of pure functional code! 1190 \end{itemize} 1116 \framesubtitle{How're you gonna get your day's work done?} 1117 % OK, nobody is going to get the reference... 1118 \begin{itemize} 1191 1119 \item Laziness isn't very useful 1192 1120 \begin{itemize} … … 1198 1126 \end{itemize} 1199 1127 \end{itemize} 1128 (追記) \end{frame} (追記ここまで) 1129 (追記) (追記ここまで) 1130 (追記) \begin{frame}[fragile] (追記ここまで) 1131 (追記) \frametitle{How we use Haskell} (追記ここまで) 1132 (追記) \framesubtitle{Monads in disguise} (追記ここまで) 1133 (追記) \begin{itemize} (追記ここまで) 1134 (追記) \item Tock is a \emph{practical} system, therefore\ldots (追記ここまで) 1135 (追記) \item Monads, monads, monads (追記ここまで) 1136 (追記) \item Not a lot of pure functional code (追記ここまで) 1137 (追記) \item Heavy use of monad transformers (追記ここまで) 1138 (追記) \end{itemize} (追記ここまで) 1139 (追記) \begin{lstlisting} (追記ここまで) 1140 (追記) type PassM = ErrorT ErrorReport (StateT CompilerState IO) (追記ここまで) 1141 (追記) type CodeGenM = WriterT [String] PassM (追記ここまで) 1142 (追記) \end{lstlisting} (追記ここまで) 1200 1143 \end{frame} 1201 1144
Note:
See TracChangeset
for help on using the changeset viewer.