Micro-Benchmarking Scala Code - The Easy Way

Posted by Mathias in [scala]

19 Apr 2011

While evaluating, which of the numerous available Scala JSON implementations to use for spray once again I found myself in need of some tool simplifying the writing of proper JVM benchmarks.
Manually writing benchmarks for the JVM that actually measure what you intend to measure is much harder than it initially appears. There are quite a few rules to keep...

How to make SBT download scala library sources

Posted by Mathias in [scala]

17 Dec 2010

Being in the process of setting up a new machine for Scala development I once again found myself scratching my head over a question I already faced several times in the past:
How to persuade SBT to automatically download not just the Scala standard library jar for my target Scala version but also the corresponding sources?

Since readily available information about this...

The QuickPimp Pattern

Posted by Mathias in [scala]

02 Dec 2010

Anyone turning to Scala for developing non-trivial applications will come across a number of more or less established Scala Design Patterns. One of the most widely-used ones is the “Pimp my Library” Pattern, which got it’s name from a short article Martin Odersky wrote in October 2006.

This pattern denotes the way in which you can augment (or “pimp”) an...

An integrated SBT + IDEA Scala Development Setup

Posted by Mathias in [scala]

12 Oct 2010

One of the more discussed topics at the Scala Lift Off in London last week was the Scala development setup favored by the various people. There are quite a few options, preferences depend to a large extend on the individual likings. However, there appeared to be a clear preference for SBT as the build tool of choice and a lot...

Scala Collections API Charted Out

Posted by Mathias in [scala]

02 Sep 2010

The revamped collections API is one of cornerstones of the recently released Scala version 2.8.
It provides an incredibly rich toolset for working with object collections and as such is one of the most important parts of the Scala runtime library. The Scala team has made an effort to provide thorough documentation uncovering its feature breadth, the most important sources of information...

Scala rich wrapping performance

Posted by Mathias in [scala]

27 Aug 2010

Recently I repeatedly found myself wondering whether relying on Scalas rich wrappers for convenience was actually coming with some performance cost or not. Not that it really matters in all but some really time-critical edge cases, however, I remember reading something about modern JVMs being able to completely optimize these wrapping constructs away (by means of so-called “escape analysis”?), so maybe there...

Installing Apache Buildr on OS/X 10.6

Posted by Mathias in [scala]

20 Aug 2010

For my first larger, Scala-only project I just set up a brand-new project space.
Normally all my projects have an IntelliJ IDEA project structure set up for the day-to-day work. However, I usually also include a paralleling project spec for some build system for creating the final deployment or distribution artifacts. For all my Java projects this is (and always has been)...