equal
deleted
inserted
replaced
184 \end{quote} |
184 \end{quote} |
185 |
185 |
186 \noindent\alert |
186 \noindent\alert |
187 For PEP, make sure you are using the version 3(!) of Scala. This is |
187 For PEP, make sure you are using the version 3(!) of Scala. This is |
188 the version I am going to use in the lectures and in the coursework. This |
188 the version I am going to use in the lectures and in the coursework. This |
189 can be any version of Scala 3.X where $X=\{4,5\}$. Also the minor |
189 can be any version of Scala 3.X where $X=\{4,5,6,7\}$. Also the minor |
190 number does not matter. Note that this will be the second year I am |
190 number does not matter. Note that this will be the second year I am |
191 using this newer version of Scala -- some hiccups can still happen. Apologies |
191 using this newer version of Scala -- some hiccups can still happen. Apologies |
192 in advance!\bigskip |
192 in advance!\bigskip |
193 |
193 |
194 %\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
194 %\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black] |
212 there is work under way to have a native Scala compiler generating |
212 there is work under way to have a native Scala compiler generating |
213 X86-code (\url{http://www.scala-native.org}). There are also some |
213 X86-code (\url{http://www.scala-native.org}). There are also some |
214 tricks for Scala programs to run as a native |
214 tricks for Scala programs to run as a native |
215 GraalVM~\hr{https://scala-cli.virtuslab.org/docs/cookbooks/native-images/} |
215 GraalVM~\hr{https://scala-cli.virtuslab.org/docs/cookbooks/native-images/} |
216 image. Though be warned these backends are still rather beta or even |
216 image. Though be warned these backends are still rather beta or even |
217 alpha. |
217 alpha. But for the coursework we are going to use the ``vanilla'' Scala compiler. |
218 |
218 |
219 \subsection*{VS Code and Scala} |
219 \subsection*{VS Code and Scala} |
220 |
220 |
221 I found a convenient IDE for writing Scala programs is Microsoft's |
221 I found a convenient IDE for writing Scala programs is Microsoft's |
222 \textit{Visual Studio Code} (VS Code) which runs under MacOSX, Linux and |
222 \textit{Visual Studio Code} (VS Code) which runs under MacOSX, Linux and |
250 package \textbf{Scala Syntax (official)} 0.5.7 from Marketplace. |
250 package \textbf{Scala Syntax (official)} 0.5.7 from Marketplace. |
251 I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
251 I have also bound the keys \keys{Ctrl} \keys{Ret} to the |
252 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
252 action ``Run-Selected-Text-In-Active-Terminal'' in order to quickly |
253 evaluate small code snippets in the Scala REPL. I use Codium's internal |
253 evaluate small code snippets in the Scala REPL. I use Codium's internal |
254 terminal to run \texttt{scala} version 1.0.5 which |
254 terminal to run \texttt{scala} version 1.0.5 which |
255 uses Scala 3.3.1.\label{vscode}} |
255 uses Scala 3.7.3.\label{vscode}} |
256 \end{boxedminipage} |
256 \end{boxedminipage} |
257 \end{figure} |
257 \end{figure} |
258 |
258 |
259 Actually \alert last year I switched to VS Codium as IDE for writing Scala programs. VS Codium is VS Code |
259 Actually \alert last year I switched to VS Codium as IDE for writing Scala programs. VS Codium is VS Code |
260 minus all the telemetry data that is normally sent to Microsoft. Apart from |
260 minus all the telemetry data that is normally sent to Microsoft. Apart from |
543 you installed \texttt{scala}, you can start the interpreter by typing on the |
543 you installed \texttt{scala}, you can start the interpreter by typing on the |
544 command line: |
544 command line: |
545 |
545 |
546 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] |
546 \begin{lstlisting}[language={},numbers=none,basicstyle=\ttfamily\small] |
547 $ scala |
547 $ scala |
548 Welcome to Scala 3.5.1 (21.0.4, Java OpenJDK 64-Bit Server VM). |
548 Welcome to Scala 3.7.3 (21.0.8, Java OpenJDK 64-Bit Server VM). |
549 Type in expressions for evaluation. Or try :help. |
549 Type in expressions for evaluation. Or try :help. |
550 |
550 |
551 scala> |
551 scala> |
552 \end{lstlisting}%$ |
552 \end{lstlisting}%$ |
553 |
553 |