Back To Schedule
Room 3 - Foundations

Thursday June 13th, 11:30-12:15

Pick your number type with Spire

About this Session

Scala provides a variety of number types: `Int`, `BigInt`, `Float`, `Double`, `BigDecimal`... and Spire adds a few types on top: `Rational`, `Real`, `Interval`. What are their use cases? What are the corresponding tradeoffs in robustness, precision, speed, memory, and availability of operations? How can we swap quickly between number types in a code base? How fast is Scala JVM/JS/Native compared to C++?

The visual benchmarks will be based on the Mandelbrot fractal.

Required Knowledge

In the Scala levels, a mix of A1 and L1; corresponds to the syntax covered in Functional Programming Principles in Scala, but with imperative code style.

The talk will introduce implicits and typeclasses but no prior knowledge is assumed.


Denis Rosset

I am a maintainer of the Spire library and a postdoctoral researcher at Perimeter Institute working on probabilistic models. I use Scala extensively in my research work and wrote Spire-based libraries to handle linear algebra, permutations or array-backed data structures. When not using Scala, I write code in MATLAB and curiously enjoy it. I participated at the 2018 Scala Spree at EPFL, and brought a small group of participants to their first Spire contribution.