77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
78 \begin{frame}[c] |
78 \begin{frame}[c] |
79 \frametitle{Why Scala?} |
79 \frametitle{Why Scala?} |
80 |
80 |
81 \begin{itemize} |
81 \begin{itemize} |
82 \item compiles to the JVM (also JavaScript, X86)\medskip |
82 \item compiles to the JVM\\ (also JavaScript, native X86 in the works)\medskip |
83 \item integrates seamlessly with Java\medskip |
83 \item integrates seamlessly with Java\medskip |
84 \item combines {\bf functional} and {\bf object-oriented} programming\medskip |
84 \item combines \underline{\bf functional} and {\bf object-oriented} programming\bigskip |
85 \item allows often to write more elegant code |
85 \item often one can write very concise and elegant code |
86 \end{itemize} |
86 \end{itemize}\bigskip\medskip |
|
87 |
|
88 \small |
|
89 alternatives: Elm, Haskell, Ocaml, ML, Lisp (Racket), \ldots |
87 |
90 |
88 \end{frame} |
91 \end{frame} |
89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
92 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
90 |
93 |
91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
94 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
93 \frametitle{Java vs Scala} |
96 \frametitle{Java vs Scala} |
94 |
97 |
95 {\lstset{language=java}\fontsize{12}{12}\selectfont |
98 {\lstset{language=java}\fontsize{12}{12}\selectfont |
96 \texttt{\lstinputlisting{Point.java}}} |
99 \texttt{\lstinputlisting{Point.java}}} |
97 |
100 |
|
101 \rule{11cm}{0.3mm}\\[-2mm] |
|
102 |
98 {\lstset{language=scala}\fontsize{12}{12}\selectfont |
103 {\lstset{language=scala}\fontsize{12}{12}\selectfont |
99 \texttt{\lstinputlisting{Point.scala}}} |
104 \texttt{\lstinputlisting{Point.scala}}} |
100 |
105 |
101 \begin{textblock}{6}(13,3) |
106 \begin{textblock}{6}(13,3) |
102 \textbf{\large Java} |
107 \textbf{\large Java} |
103 \end{textblock} |
108 \end{textblock} |
104 |
109 |
105 \begin{textblock}{6}(13,13.2) |
110 |
|
111 |
|
112 \begin{textblock}{6}(13,13.4) |
106 \textbf{\large Scala} |
113 \textbf{\large Scala} |
107 \end{textblock} |
114 \end{textblock} |
108 |
115 |
109 \end{frame} |
116 \end{frame} |
110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
111 |
118 |
112 |
119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
120 \begin{frame}[c] |
|
121 \frametitle{Scala Tools} |
|
122 |
|
123 \begin{itemize} |
|
124 \item there is a plugin for Eclipse (called Scala IDE)\medskip |
|
125 \item there is also a plugin for IntelliJ\bigskip |
|
126 \item I use the venerable Emacs ;o) |
|
127 \end{itemize} |
|
128 |
|
129 \end{frame} |
|
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
113 |
131 |
114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
115 \begin{frame}[c] |
133 \begin{frame}[c] |
116 \frametitle{Types} |
134 \frametitle{Types} |
117 |
135 |
118 \begin{itemize} |
136 \begin{itemize} |
119 \item Base types |
137 \item Base types\smallskip |
120 |
138 |
121 \begin{center} |
139 \begin{tabular}{@{}l@{}} |
122 \begin{tabular}{l} |
|
123 \textcolor{codegreen}{\texttt{Int}}, |
140 \textcolor{codegreen}{\texttt{Int}}, |
124 \textcolor{codegreen}{\texttt{Long}}, |
141 \textcolor{codegreen}{\texttt{Long}}, |
125 \textcolor{codegreen}{\texttt{BigInt}}, |
142 \textcolor{codegreen}{\texttt{BigInt}}, |
126 \textcolor{codegreen}{\texttt{Float}}, |
143 \textcolor{codegreen}{\texttt{Float}}, |
127 \textcolor{codegreen}{\texttt{Double}}\\ |
144 \textcolor{codegreen}{\texttt{Double}}\\ |
128 \textcolor{codegreen}{\texttt{String}}, |
145 \textcolor{codegreen}{\texttt{String}}, |
129 \textcolor{codegreen}{\texttt{Char}}\\ |
146 \textcolor{codegreen}{\texttt{Char}}\\ |
130 \textcolor{codegreen}{\texttt{Boolean}} |
147 \textcolor{codegreen}{\texttt{Boolean}} |
131 \end{tabular} |
148 \end{tabular} |
132 \end{center} |
149 |
133 |
150 \item Compound types \smallskip |
134 \item Compound types |
151 |
135 |
152 \begin{tabular}{@{}ll@{}} |
136 \begin{center} |
|
137 \begin{tabular}{ll} |
|
138 \textcolor{codegreen}{\texttt{List[Int]}} & lists of Int's \\ |
153 \textcolor{codegreen}{\texttt{List[Int]}} & lists of Int's \\ |
139 \textcolor{codegreen}{\texttt{Set[Double]}} & sets of Double's \\ |
154 \textcolor{codegreen}{\texttt{Set[Double]}} & sets of Double's \\ |
140 \textcolor{codegreen}{\texttt{(Int, String)}} & Int-String pair\\ |
155 \textcolor{codegreen}{\texttt{(Int, String)}} & Int-String pair\\ |
141 \textcolor{codegreen}{\texttt{List[(BigInt, String)]}} & |
156 \textcolor{codegreen}{\texttt{List[(BigInt, String)]}} & |
142 lists of BigInt-String\\ |
157 lists of BigInt-String\\ |
143 & pairs\\ |
158 & pairs\\ |
144 \textcolor{codegreen}{\texttt{List[List[Int]]}} & list of lists of Int's\\ |
159 \textcolor{codegreen}{\texttt{List[List[Int]]}} & list of lists of Int's\\ |
145 \end{tabular} |
160 \end{tabular} |
146 \end{center} |
|
147 |
161 |
148 \end{itemize} |
162 \end{itemize} |
149 |
163 |
150 \end{frame} |
164 \end{frame} |
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
202 \includegraphics[scale=0.50]{../pics/skeleton.jpg}\\ |
213 \includegraphics[scale=0.50]{../pics/skeleton.jpg}\\ |
203 \end{textblock}} |
214 \end{textblock}} |
204 \end{frame} |
215 \end{frame} |
205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
206 |
217 |
|
218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
219 \begin{frame}[c] |
|
220 \frametitle{Conclusion} |
|
221 |
|
222 \begin{itemize} |
|
223 \item Scala is still under heavy development\\ (the compiler is terribly slow)\medskip |
|
224 \item {\bf\url{http://www.scala-lang.org/}}\bigskip |
|
225 \item it is a rather \textbf{\alert{deep}} language\ldots i.e.~gives you a lot of |
|
226 rope to shoot yourself\bigskip\bigskip |
|
227 |
|
228 \item hope you have fun with the coursework |
|
229 \end{itemize} |
|
230 \end{frame} |
|
231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
232 |
|
233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
234 \begin{frame}[c] |
|
235 \frametitle{\begin{tabular}{c}\\[3cm]\alert{Questions?}\end{tabular}} |
|
236 |
|
237 \mbox{} |
|
238 \end{frame} |
|
239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
240 \end{document} |
207 |
241 |
208 |
242 |
209 \end{document} |
243 \end{document} |
210 |
244 |
211 %%% Local Variables: |
245 %%% Local Variables: |