tags:

views:

3088

answers:

6

Scala seems to have a .net implementation too. I was wondering if it's a complete implementation with no lose ends or just a showcase thing.

It's important because the app we are about to develop should have Windows GUI besides the main implantation on web. Having a language where the core code can be ported between two implantations looks like a deal maker.

Anyone worked on the .NET implementaion of Scala? Any feedback?

+5  A: 

The Wikipedia entry claims:

An alternative implementation exists for the .NET platform, but it has not been kept up to date. (citation needed)

The "limitations" section of the FAQ has this entry:

Does Scala work on .Net?

Yes, the current Scala distribution can compile program for the .Net platform. The .Net platform has many similarities to Java but it has also many idiosyncrasies, making maintaining this port is a complicated task. The MSIL/.Net version of Scala implements at this stage virtually the entire Scala language, and most of the standard libraries. One significant limitation is that structural types do not yet work on .NET. There may still be problems when using particularly complex exception handlers. A small number of libraries are not available due to the peculiarities of .Net, and the interaction with other .Net languages is unsupported. For further details, please refer to this (possibly a bit outdated) documentation page.

The guide to using Scala with .NET talks about version 1.4, which is rather old by now. On the other hand, it looks like documentation was written as recently as 2008, including the "Scala on .NET: quirks" page which sounds pretty important.

Without having any experience of it myself, it sounds like support is limping along, but that the .NET port isn't really a first-class citizen. The fact that there's no "buzz" around Scala on .NET (compared with the Java version) isn't encouraging either. It doesn't sound like something I'd want to use for commercial software at the moment. Of course, it's possible that it's fine, and just not well marketed. If you're really keen on the idea, I'd ask on a mailing list.

Why not either use the Eclipse RCP for a Java/Scala-based Windows client, or use .NET for the web app?

Jon Skeet
+16  A: 

I have heard new funding has been acquired for the .NET side, but at the moment it is a great and increasing distance from "production ready" or even "usable". There hasn't been a check-in which meaningfully touched the .NET side in a long time.

Update Jan 15 2010: A recent message to one of the scala lists.

From: Lukas Rytz

On Fri, Jan 15, 2010 at 03:18, Naftoli Gugenheim wrote:

Not sure if this is what you're looking for but I think H2 can be run on
.NET, according to its documentation/website.
If you're looking for a database engine programmed in Scala, personally I
haven't heard of any but that doesn't mean anything.
If you mean an ORM etc. there are a few. You can use Lift Mapper even in a
non-Lift application (just include the webkit and util jars IIRC).
What is the status of Scala on .NET?

We're working on bootstrapping the compiler and we're fixing MSIL-Backend-Bugs along the way. EPFL will provide a compiler running on .NET (which uses IKVM.OpenJDK.Core.dll, at least in a first version)

Right now, we have a cross-compiler running on the JVM, and a reduced version of scala-library.jar which runs on .NET.

For some parts we will rely on the community (e.g. porting more of scala-library.jar to .NET).

Lukas

extempore
+3  A: 

This fellow has a guide to using Scala 2.7.1 on .NET. Looks like it is not perfect, but it might get you a lot closer.

starkos
+3  A: 

At the moment -- no, not really, which is a great pity, since it's quite a fun language.

"Hello world" type programs, fine -- even fancy tricks like writing a simple stack where a small piece of Python (the same code under Jython or IronPython) drives the same piece of Scala.

Anything moderately taxing -- the scalac-net compilation can and will throw, even if the code doesn't use anything outside the scala namespace, and builds and passes a fairly exhaustive set of unit tests on the JVM. It can balk at building against even fairly simple assemblies (even if built using .net 1.0, to match the low spec of the mscorlib included in the scala-msil bundle).

My test-sets for "moderately taxing" have included the following implementations intended to compensate for current lacks on .net

  • a port to Scala of a C# library for BigInteger (from codeplex, with my own unit tests)
  • a port to Scala of the Java code in scala.actors
Steve Gilham
A: 

Looking in the SVN repo, there's definitely some activity going on in the .net space. In 2.7.x there was a dotnet-library directory, but that's gone in 2.8.x and trunk. Instead there is a msil directory which has had some non-trivial things going on as recently as 4 months ago by rytz.

All the documentation available seems to be way out of date, but maybe it's worth asking one of the main contributors what the current status is. Note that extempore (who as already answered this over a year ago) seems to be one of them.

t0rx
A: 

As of Scala Days 2010 in April, Miguel Garcia was working on Scala.NET. I believe he's working on a visual studio plugin and I'm not sure how far along things are, however you can find evidence of his work here:

http://lamp.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/ http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/MixedSourceScalaCSharp.pdf http://www.sts.tu-harburg.de/people/mi.garcia/ScalaCompilerCorner/ScalaNetLearnsLINQTricks.pdf

Miguel is now doing his postdoc at EPFL: http://lamp.epfl.ch/~magarcia/

Paul (extempore)'s answer probably has more up-to-date information, but if I were curious I might ask Miguel directly.

jsuereth