[IPython-dev] IScala: a Scala-language backend for IPython

Mateusz Paprocki mattpap@gmail....
Sun Sep 8 14:54:14 CDT 2013


Hi,

I would like to announce IScala: a Scala-language backend for IPython,
see [1]. Scala is general purpose, object-functional, statically typed
programming language for JVM. IScala is an early work in progress, but
it's already fairly usable. All three types of frontends are
supported. Required dependencies are IPython 1.0+ and Java Runtime
Environment 1.6+. See README.md for installation and usage details.

Motivation for this project came when I saw IJulia announcement. The
hard part - actually "interpreting" Scala - was done in Scala REPL by
Scala developers. Scala is a compiled language, so interpreting it
means that source code is compiled (with some fancy wrappers),
resulting class files loaded into JVM and code run via Java
reflection. Interpreted code behaves exactly the same as compiled code
and it runs at full speed. There are a few issues with this, however.
Scala is a pure object-oriented language, so at top level you can put
only packages, traits, classes and singleton objects. No expressions
and other types of statements are allowed. Interpreter removes this
restriction, by wrapping source code in singleton objects, so that you
can simply write e.g. `val x = 1` to define a value, which is
otherwise illegal.

During development of IScala I also created a set of notebooks with
Scala code, see [2]. Those are based on a subset of Twitter's Scala
lessons [3]. I didn't encode notebooks directly in the JSON-based
format, but I invented an adhoc format based on Markdown with support
for cells. There is a simple converter that allows to generate
IPython-compatible notebooks.

[1] https://github.com/mattpap/IScala
[2] https://github.com/mattpap/scala_school_notebooks
[3] https://github.com/twitter/scala_school

Mateusz


More information about the IPython-dev mailing list