Scala comes to .NET/Mono
Written by Andrew Johnson   
Tuesday, 26 July 2011

The Scala website, fount of all Scala information, has an interview and some details of a project to bring Scala to .NET and hence Mono. The project is sponsored by Microsoft which has interesting implications in itself.

UPDATE Scala's .NET support was dropped in December 2012

The key person involved in the project is Miguel Garcia, part of the Scala group at EPFL ( École Polytechnique Fédérale de Lausanne) which is of course where the language was invented.




The current state of the project is that you can actually write Scala programs that run under .NET. There are a few limitations in using .NET libraries but these should be fixed in the near future. You can also use Visual Studio to build Scala programs but at the moment the plugin doesn't support nice features such as autocomplete etc. A new plugin, expected later in the year, is promised to provide full code support but you can use JVM IDE tools and simply import the completed code later.

The Scala .NET compiler is claimed to be robust and proof of this is that fact that it can compile itself at over 100K lines of Scala. The current compiler is a port of a cross-compiler that runs on the JVM and made use of JDK dependencies which ruled out bootstrapping to .NET by self compiling. The  .NET compiler is written in Scala but it is compiled to byte code using the standard Scala compiler. The first step on the road to creating a compiler that would run under .NET was to use the existing IKVM compiler which takes JVM byte code and outputs .NET IL. 

Running the .NET compiler's byte code though IKVM didn't produce a compiler that runs under .NET, however, because of the JDK dependencies. The solution to this was to create an automatic mapping tool for the standard Scala compiler that would take out the dependencies and replace them by IKVM .NET equivalents. With this refinement it was possible to create an IL version of the .NET compiler that runs under .NET and compile itself - bootstrapping completed!

More Information

"how to use" guide

Scala  .Net

Scala NET interview


If you would like to be informed about new articles on I Programmer you can either follow us on Twitter or Facebook or you can subscribe to our weekly newsletter.



Learn To Develop On Android With MAD Skills

Modern Android Development (MAD) Skills is a free series of videos and articles by Google that teaches the modern ways of doing development on the Android platform.

Spatial AI Competition A Winner

When OpenCV launched a Computer Vision contest earlier this year, it expected to award three prizes, totalling $6,000. The competition was so popular that it has now announced six winners who share $1 [ ... ]

More News





Last Updated ( Wednesday, 23 April 2014 )