Computational astrophysics with Scala