Friday, 28 September 2007

Ray tracer language comparison ported to Scala

Derek Young has kindly ported the first Java implementation of our ray tracer language comparison to two alternative languages that both also target the JVM.

  • Scala: a statically-typed functional programming language.
  • Groovy: a dynamic programming language.

Interestingly, the Scala translation is not only shorter than the equivalent Java but also slightly faster. The same correlation is seen on .NET, where F# is often slightly faster than C# because it can perform valuable high-level optimizations not exposed by lower-level languages like C#, e.g. optimizing pattern matches.

Interest in Scala continues to grow and we are considering writing a Scala for Scientists book, following our OCaml for Scientists and F# for Scientists books. If you would like to learn about technical computing using Scala then please show your support by commenting on this blog post.

17 comments:

Raju said...

Absolutely! I have been meaning to get into Scala, and have been a little discouraged by the lack of documentation. Looking at lift provides a good starting point, but a "Scala for Scientists" would be great!

Christopher said...

I've just started getting into scala and would love to buy a book on it. There is just way too much good code out there for the JVM to walk away from when there is a language as good a scala [seems to be so far] that can use it.

Roland Kaufmann said...

The appeal of Scala is besides the use of the runtime platform of the JVM, the focus the development team seems to have on composition of modules, both points where I find Ocaml somewhat insufficient. Now if they could only find a way to reconsile nuObj with less type annotations...
Another problem is of course to search for "Scala and LAPACK" and get past all the hits for ScaLapack.

fgantt said...

Absolutely!

Qrilka said...

For sure!

Andrew said...

Yes please!

TylerWeir said...

I'd love to see Scala for Scientists.

Peter Thomas said...

Yes!

A NetBeans plugin for Scala also if anyone is listening.

fjossinet said...

Definitively yes !!

Pete said...

Another yes

Michael Nischt said...

100% Agree: A good Book and Netbeans plug-in - that's my wish-list for christmas.. I know writing and publishing takes time, so easter is also fine ;-)

fils said...

Both Scala and Fortress would be of interest. The power of Scala mixed with the rich Java class library is very exciting. I recently tested calling Scala objects from Groovy scripts and it appears to work perfectly. The ability to call on the power of Scala from a dynamic environment like that of Groovy is a wonderful combination.

A common JVM with Scala, Groovy, Java and perhaps even Fortress code running together really seems sweet.

Steve Jenson said...

I would also pay for Scala for Scientists. I would even buy copies for my friends.

janko said...

Yes, me too!

m said...

yes for me.

gabe said...

would buy a "Scala for Scientists" in an instant.

Shinka said...

I would also be interested, the problem with "F# for scientists" is that many scientists, especially theoretical scientists, use either Linux or Mac, where F# doesn't work well (I know about Mono, but it's seriously lagging behing microsoft's .net)