Denis Rosset at Scala Days: “Scala’s flexibility is a blessing and a curse.”

A maintainer of the Spire library and a postdoctoral researcher at Perimeter Institute working on probabilistic models, Denis Rosset uses Scala extensively in his research work and wrote Spire-based libraries to handle linear algebra, permutations or array-backed data structures. When not using Scala, he writes code in MATLAB and curiously enjoys it.

In advance of his Scala Days talk “Pick your number type with Spire”, we spoke to Denis about his research work and how he uses Scala in quantum mechanics, the biggest challenge Scala developers are facing at the moment and his upcoming debut at Scala Days.  

What’s your background and what does your current role involve?

I’m a physicist doing research on the foundations of quantum information at Perimeter Institute. Most current topics in the field map to optimization problems in some form or another – and that’s even before the invasion of machine learning techniques! Currently, I use Scala to construct faster formulations of those problems (with typical speed-ups factors of 1000-10000x).

What’s the biggest highlight of your career so far?

The creation of a Web database to classify fundamental research objects used to probe the structure of quantum mechanics, written in Scala with a Play frontend: http://faacets.com/.

Why did you choose Scala and what kind of problems does it solve for you?

Software developed in academia is often poorly documented or left unmaintained after researchers move to other topics. A rigorous type system acts as “free documentation”. In my opinion, Scala is a practical language: if you know Java, you already know a subset of Scala — and at the same time, the type system is expressive enough to encode various problem domains. On top of this, I experienced that the emphasis on correctness in the Scala world led to a dramatic reduction of bugs compared to scientific languages such as Matlab or Python/numpy/scipy (using declaration of structures: cats, spire, scalaz, and law-based checks: scalacheck, discipline).

Finally, Scala scales down from low level code (arrays + bit manipulations) up to high level constructs (DSLs). In my opinion, Scala is underrated for the writing of scientific software: in comparison, many computer algebra systems are written in a mixture of their own language and C/C++ (see Singular, Macaulay2, GAP System). Scala, one language to rule them all?

What’s the most important challenge that Scala developers are facing today?

Scala’s flexibility is a blessing and a curse. For example, libraries and tutorials are fragmented between styles that correspond roughly to Java, ML and Haskell.

What’s one thing that could address this challenge?

I like the ongoing work on Dotty on extension methods/type classes, so that Scala finds its own voice and does not simply mimic Haskell, push more FP concepts to the mainstream.

However, I’m worried about the transition period where the new concepts will be introduced and the old syntax will still be available.

Share with us your favorite Scala Days story/memory

This is the first time I participate in Scala Days. However, I have excellent memories of the Scala Spree in December 2018. Just at the beginning of the event, Darja pushed me to propose Spire as a project for people to hack on, and I had to come up with bite-sized projects on the spot!

Who should attend your talk at Scala Days and why?

Anybody interested in the variety of numerical types available in Scala (Double, BigInt, BigDecimal…), and that’s even before considering what Spire brings to the table (rationals, algebraic numbers, etc.)! Their tradeoffs: precision, speed… and how Scala Native competes with the JVM in numerics.

Whom would you like to connect with at the conference?

People solving optimization problems in industry, in particular convex problems (LP, SOCP, SDP) and polynomial problems. Solving those problems faster and more robustly is one of my research topics.

Tell us more, something we haven’t covered with our questions but you would really like to share with the world?

I can’t wait to meet people in the diverse community of Scala users!

Don’t miss Denis Rosset and his talk  “Pick your number type with Spire” at Scala Days Lausanne on June 13th. Book your ticket now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.