From Scala to ByteCode...
summary
Shows exactly what scalac and javap produce: scalac phases: 25 steps culminating in a JVM generation phase, class files hold a constant pool, field/method tables and bytecode instructions (there are about 200 JVM opcodes). Demonstrates concrete artifacts: Scala objects create companion classes like Config and Config$, traits become interfaces plus a $class with static impls, lazy vals use a bitmap plus monitor enter/exit for thread-safe init (about 30 lazies per int bitmask), and @specialized spawns many primitive-specialized class permutations.
AI-written summary · about
chapters (18)
- 0:00Introduction and setup
- 1:23Bytecode basics and JVM
- 3:39Scala compilation phases
- 6:36Class file structure
- 9:06Constant pool explained
- 12:30Method bytecode details
- 14:16Demo of bytecode execution
- 16:05Scala features in bytecode
- 16:50Scala objects vs Java static
- 17:53Scala case classes
- 19:41Scala traits implementation
- 21:28Multiple trait inheritance
- 22:34Method references in Scala
- 25:44Lazy values implementation
- 27:54String and function specialization
- 30:08Specialized function types
- 31:15Function currying in bytecode
- 34:21Q&A and closing
related talks
47mA Deep Dive into Scalac
16mWhat You See & What You Get
35mJava Source to Byte Code Transformation - The Hidden Story!
53mWell there's your problem! Your engine's missing! A look under Java's hood
39mBytecode Pattern Matching
57mDecoding Java: From Source Code to Bytecode
01h 07mFrom Java to Assembly: Down the Rabbit Hole
53mFROM SCALA TO ASSEMBLY THE COST OF ABSTACTION REVISITED
