def and var in traits on Scala 2.12, 2.13 and 3.0.0

Scala traits should define defs, because “A val can override a def, but a def cannot override a val” (via Alvin Alexander via StackOverflow). But it’s interesting to look at how the compiler treats that. Alvin Alexander did that, but only for Scala 2.12.8. Let’s have a look at 2.12, 2.13 and the just released 3.0 (formerly known as dotty). ...

April 24, 2021 · Jannik Arndt

Using scalap, javap and the scala compiler to understand the journey from code to bytecode

Do you know what happens after you compile? Let’s take a look at what the Scala compiler tells us, and what scalap and javap can reveal about .class files. ...

March 25, 2021 · Jannik Arndt