Book contents
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 Core features
- 3 Advanced features
- 4 Parser builders
- 5 XML processing
- 6 GUI programming
- 7 Concurrent programming
- 8 On paths and a bit of algebraic abstraction
- 9 Virtual files coming into existence
- 10 Compositional file matching
- 11 Searching, iterating, traversing
- 12 The expression problem
- 13 A computer algebra system
- Appendix A Multimedia processing
- Appendix B Distributing a Scala application along with Scala itself
- Appendix C Working with the compiler and the interpreter
- Appendix D Scala's grammar
- References
- Name index
- Subject index
Appendix C - Working with the compiler and the interpreter
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 Core features
- 3 Advanced features
- 4 Parser builders
- 5 XML processing
- 6 GUI programming
- 7 Concurrent programming
- 8 On paths and a bit of algebraic abstraction
- 9 Virtual files coming into existence
- 10 Compositional file matching
- 11 Searching, iterating, traversing
- 12 The expression problem
- 13 A computer algebra system
- Appendix A Multimedia processing
- Appendix B Distributing a Scala application along with Scala itself
- Appendix C Working with the compiler and the interpreter
- Appendix D Scala's grammar
- References
- Name index
- Subject index
Summary
In this appendix, we show how to use both the Scala compiler (scalac) and the Scala interpreter (scala) by experimenting with their command line arguments. Part of our presentation is based on the man pages coming with every Scala distribution. For our exposition, we assume a Unix terminal.
Scala is a scalable language. Marketing-wise this is mentioned quite frequently. The good news is that Scala is indeed scalable in many ways and, after all, there is no harm in advertising features that already exist. One such dimension of scalability has to do with the provided tools and how they can be used to increase the overall experience of programming in Scala. We will see that the features provided give a pleasant feeling that the language “grows” to our needs.
For the following, we assume that Scala is installed under a folder denoted by the value of the environment variable SCALA_HOME. Under Unix, this value is obtained by $SCALA_HOME, while under Windows this is obtained by %SCALA_HOME%. It is good practice to set this variable, since other applications that use Scala may depend on it.
The Scala compiler
The compiler is the workhorse of the whole platform. Even the interpreter uses it internally in order to give the impression of a scripting environment. As expected, it is packed with a wealth of command line options. Using scalac with no options and parameters informs us of all the options. The outcome is given in Table C.1.
- Type
- Chapter
- Information
- Steps in ScalaAn Introduction to Object-Functional Programming, pp. 449 - 462Publisher: Cambridge University PressPrint publication year: 2010