1000: Ben Titzer

Ben Titzer joins to talk about the history and future of WebAssembly, the design and implementation of V8’s TurboFan optimizing compiler, and the Virgil programming language. We also discuss bringing high-level language features to constrained hardware, the V8 team’s response to the Spectre and Meltdown side-channel attacks, and how to design high performance virtual machines.

Ben’s Site: https://s3d.cmu.edu/people/core-faculty/titzer-ben.html

Ben on LinkedIn: https://www.linkedin.com/in/ben-l-titzer-6b78584/

Ben on Twitter: https://x.com/TitzerBL

Show Notes

Welcome Ben (00:02:34)

MS-DOS (00:03:32) https://en.wikipedia.org/wiki/MS-DOS

First Computer (00:04:06)

DIMMs and SIMMs (00:04:38) https://en.wikipedia.org/wiki/DIMM https://en.wikipedia.org/wiki/SIMM

Intel 386SX (00:04:45) https://en.wikipedia.org/wiki/I386#80386SX

MS-DOS 5 (00:04:48) https://winworldpc.com/product/ms-dos/50

BASIC (00:05:10) https://en.wikipedia.org/wiki/BASIC

Batch Files (00:05:14) https://en.wikipedia.org/wiki/Batch_file

Jurassic Park Password Scene (00:05:20) https://youtu.be/RfiQYRn7fBg

Teach Yourself C Programming in 21 Days (00:05:54) https://www.goodreads.com/en/book/show/1170172

C (00:06:19) https://en.wikipedia.org/wiki/C_(programming_language)

Pascal (00:06:24) https://en.wikipedia.org/wiki/Pascal_(programming_language)

Python (00:06:28) https://www.python.org/

Borland Turbo C++ for DOS (00:06:46) https://winworldpc.com/product/turbo-c/3x

C++ (00:07:17) https://en.wikipedia.org/wiki/C%2B%2B

Earliest Programming Projects (00:07:29)

Microsoft Encarta (00:07:46) https://en.wikipedia.org/wiki/Encarta

Moving to Lower Levels of the Stack (00:08:54)

Getting on the Internet (00:09:03)

Assembly (00:09:18) https://en.wikipedia.org/wiki/Assembly_language

Windows 95 (00:09:50) https://en.wikipedia.org/wiki/Windows_95

Designing First Programming Language (00:10:52)

Exposure to Computer Science Before College (00:12:21)

Decision to Study Computer Science (00:13:29)

Purdue University (00:13:50) https://www.cs.purdue.edu/

Java (00:14:22) https://en.wikipedia.org/wiki/Java_(programming_language)

Operating Systems Class (00:14:36)

Compilers Class (00:15:08)

Tony Hosking (00:15:27) https://hosking.github.io/

Starting Undergraduate Research (00:15:44)

Jan Vitek (00:16:08) http://janvitek.org/

OVM Project (00:16:15) https://www.cs.purdue.edu/homes/hosking/papers/idioms.pdf

Why Java? (00:16:48)

The Benefits of Memory Safety (00:17:18)

Java Virtual Machine (JVM) (00:17:45) https://en.wikipedia.org/wiki/Java_virtual_machine

Just-in-Time Compilation (JIT) (00:18:21) https://en.wikipedia.org/wiki/Just-in-time_compilation

Portability of Java (00:19:02)

James Gosling (00:19:57) https://en.wikipedia.org/wiki/James_Gosling

Origins of Java (00:20:00)

Robert Garner on the Microarch Club (00:20:40) https://microarch.club/episodes/11/

Avrora Project (00:21:30) http://compilers.cs.ucla.edu/avrora/

Aurora Borealis (00:21:51) https://en.wikipedia.org/wiki/Aurora

Where Did the Name Avrora Come From? (00:22:00) http://compilers.cs.ucla.edu/avrora/origin.html

Decision to go to Graduate School (00:22:41)

Interning at Sun Microsystems (00:23:13) https://en.wikipedia.org/wiki/Sun_Microsystems

UCLA (00:23:25) https://www.cs.ucla.edu/

Sun Labs (00:23:56) https://en.wikipedia.org/wiki/Oracle_Labs

HotSpot VM (00:24:03) https://en.wikipedia.org/wiki/HotSpot_(virtual_machine)

AVR Microcontrollers (00:24:42) https://en.wikipedia.org/wiki/AVR_microcontrollers

Jens Palsberg (00:24:50) https://web.cs.ucla.edu/~palsberg/

Sensor Networks (00:25:04) https://en.wikipedia.org/wiki/Wireless_sensor_network

Deborah Estrin (00:25:14) https://tech.cornell.edu/people/deborah-estrin/

IntelliJ (00:26:02) https://www.jetbrains.com/idea/

Cycle-Accurate Simulation (00:27:36) https://retrocomputing.stackexchange.com/questions/1191/what-exactly-is-a-cycle-accurate-emulator

The Purpose of Sensor Networks (00:28:08)

Smartdust (00:29:13) https://en.wikipedia.org/wiki/Smartdust

Power Requirements of Radios (00:29:29)

The Virgil Programming Language (00:30:03) https://github.com/titzer/virgil

Virgil Academic Papers (00:31:00) https://research.google/pubs/pub41446.pdf https://web.cs.ucla.edu/~palsberg/paper/oopsla10.pdf https://web.cs.ucla.edu/~palsberg/paper/cases07.pdf

Virgil: Objects on the Head of a Pin (00:31:22) https://escholarship.org/content/qt13r0q4fc/qt13r0q4fc.pdf

Design Decisions in Virgil (00:31:28)

Static vs. Dynamic Memory Allocation (00:31:54) https://en.wikipedia.org/wiki/C_dynamic_memory_allocation

Compile-Time Initialization (00:32:41)

IBM Internship (00:34:06)

ExoVM (00:34:13) https://dl.acm.org/doi/abs/10.1145/1273442.1250775

David Bacon (00:34:18) https://en.wikipedia.org/wiki/David_F._Bacon

Garbage Collection (GC) (00:34:23) https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)

J9 Configuration System (00:35:09) https://en.wikipedia.org/wiki/OpenJ9

Profile-Guided Optimization (PGO) (00:36:11) https://en.wikipedia.org/wiki/Profile-guided_optimization

Optimizing Code and Data Together (00:36:20)

Graal Native Image (00:36:53) https://www.graalvm.org/latest/reference-manual/native-image/

Bringing High-Level Language Concepts to Microcontrollers (00:37:11)

Language Runtimes (00:38:11) https://en.wikipedia.org/wiki/Runtime_system

Eliminating Features with Fixed Costs (00:39:04)

Java Object Headers (00:39:43) https://www.baeldung.com/java-memory-layout

Type Casting (00:40:13) https://en.wikipedia.org/wiki/Type_conversion

Virtual Dispatch (00:40:15) https://en.wikipedia.org/wiki/Dynamic_dispatch

Reference Compression (00:40:48) https://shipilev.net/jvm/anatomy-quarks/23-compressed-references/#_compressed_references

Pointer Analysis (00:42:34) https://en.wikipedia.org/wiki/Pointer_analysis

ROM-ization (00:42:53)

Reachable Members Analysis (00:43:26) https://en.wikipedia.org/wiki/Reachability_analysis

Dead-Code Elimination (DCE) (00:43:44) https://en.wikipedia.org/wiki/Dead-code_elimination

Linker Deduplication (00:43:46)

Whole Program Optimization (00:44:43) https://learn.microsoft.com/cpp/build/reference/gl-whole-program-optimization

Devirtualization (00:45:56) https://marcofoco.com/blog/2016/10/03/the-power-of-devirtualization/

Evolution of the Virgil Programming Language (00:47:08)

Type Parameters (00:47:28) https://java-programming.mooc.fi/part-12/1-type-parameters

Virgil III (00:47:41)

Compiler Backends (00:48:02)

Attributes of Virgil III (00:48:39)

Garbage Collection in Systems Languages (00:48:46)

Pointers to the Stack (00:49:43)

Memory Mapping (00:49:49) https://en.wikipedia.org/wiki/Memory-mapped_file

Maxine VM (00:50:05) https://en.wikipedia.org/wiki/Maxine_Virtual_Machine

Adoption of Virgil (00:50:30)

Wizard WebAssembly Engine (00:51:11) https://github.com/titzer/wizard-engine

Application Binary Interface (ABI) (00:52:09) https://en.wikipedia.org/wiki/Application_binary_interface

popcnt (00:52:26) https://www.felixcloutier.com/x86/popcnt

Single Instruction Multiple Data (SIMD) (00:52:32) https://en.wikipedia.org/wiki/Single_instruction,_multiple_data

Memory Protection (00:53:26) https://en.wikipedia.org/wiki/Memory_protection

Signals (00:53:27)

System Calls (Syscalls) (00:53:31) https://en.wikipedia.org/wiki/System_call

Goals for Virgil (00:55:07)

Rust (00:55:56) https://www.rust-lang.org/

Zig (00:55:57) https://ziglang.org/

Decision to Join Google (00:56:47)

Ken Russell (00:57:17) https://www.linkedin.com/in/kbrussell/

WebGL (00:57:29) https://en.wikipedia.org/wiki/WebGL

Oracle Acquisition of Sun (00:57:39) https://en.wikipedia.org/wiki/Acquisition_of_Sun_Microsystems_by_Oracle_Corporation

Joining v8 Team (00:58:30) https://v8.dev/ https://en.wikipedia.org/wiki/V8_(JavaScript_engine)

Crankshaft (00:58:41) https://blog.chromium.org/2010/12/new-crankshaft-for-v8.html

Lars Bak (00:58:56) https://en.wikipedia.org/wiki/Lars_Bak_(computer_programmer)

Kasper Lund (00:58:58) https://www.linkedin.com/in/kasper-verdich-lund-ab410a2/

Daniel Clifford (00:59:15) https://www.linkedin.com/in/expatdanno/

Hannes Payer (00:59:18) https://www.linkedin.com/in/hannes-payer-558051282/

JavaScript (00:59:53) https://en.wikipedia.org/wiki/JavaScript

Dynamic Scoping (01:00:13)

eval() (01:00:16) https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval

Prototypes (01:00:19) https://developer.mozilla.org/docs/Learn/JavaScript/Objects/Object_prototypes

Downsides of Crankshaft (01:01:41)

Deoptimization (01:02:10)

Folding Branches (01:02:18)

Basic Blocks (01:02:27) https://en.wikipedia.org/wiki/Basic_block

Register Allocator (01:02:34) https://en.wikipedia.org/wiki/Register_allocation

Thomas Wuerthinger (01:03:00) https://labs.oracle.com/pls/apex/f?p=94065:11:112122601315481:137

C1 Compiler (HotSpot Client Compiler) (01:03:11) https://www.oracle.com/technetwork/java/javase/tech/3198-d1-150056.pdf

C1X Compiler (01:03:19)

Christian Wimmer (01:03:36) http://www.christianwimmer.at/

Linear Scan Register Allocation for the Java HotSpot Client Compiler (01:03:38) http://www.christianwimmer.at/Publications/Wimmer04a/

C2 Compiler (HotSpot Server Compiler) (01:04:44)

Single Static Assignment (SSA) (01:05:05) https://en.wikipedia.org/wiki/Static_single-assignment_form

Sea of Nodes (01:05:11) https://en.wikipedia.org/wiki/Sea_of_nodes

Cliff Click (01:05:24) https://www.linkedin.com/in/cliff-click-b252a070/

Intermediate Representation (IR) (01:05:49) https://en.wikipedia.org/wiki/Intermediate_representation

How a Sea of Nodes Compiler Works (01:06:00) https://darksi.de/d.sea-of-nodes/

Forward Data Flow Optimizations (01:08:38) https://en.wikipedia.org/wiki/Data-flow_analysis

Strength Reduction (01:08:45) https://en.wikipedia.org/wiki/Strength_reduction

How Common is Sea of Nodes? (01:10:05)

LLVM (01:10:15) https://llvm.org/

Control Flow Graph (CFG) (01:10:20) https://en.wikipedia.org/wiki/Control-flow_graph

Downsides of Sea of Nodes (01:10:47)

Speculative Optimization (01:11:26) https://ponyfoo.com/articles/an-introduction-to-speculative-optimization-in-v8

Impact on Team Dynamics (01:12:49)

Speed of Sea of Nodes Compilers (01:14:35)

Swapping out Crankshaft for TurboFan (01:15:37)

Firefox (01:16:17) https://en.wikipedia.org/wiki/Firefox

JavaScript Core (01:16:22) https://docs.webkit.org/Deep%20Dive/JSC/JavaScriptCore.html

Edge (01:16:25) https://en.wikipedia.org/wiki/Microsoft_Edge

asm.js (01:17:01) https://en.wikipedia.org/wiki/Asm.js

Collaborating with Mozilla on WebAssembly (01:18:48)

Luke Wagner (01:18:55) https://blog.mozilla.org/luke/

Native Client (NaCl) (01:19:30) https://en.wikipedia.org/wiki/Google_Native_Client

JF Bastien (01:19:36) https://jfbastien.com/

Filip Pizlo (01:19:51) http://www.filpizlo.com/

What Makes WebAssembly Portable and Performant? (01:20:24)

WebAssembly Binary Format (01:23:20) https://danielmangum.com/posts/every-byte-wasm-module/

Structured Control Flow (01:24:01) https://en.wikipedia.org/wiki/Control_flow

The “One Weird Trick” That Makes WebAssembly Memory Fast (01:24:55)

Memory Management Unit (MMU) (01:25:26) https://en.wikipedia.org/wiki/Memory_management_unit

Passing Data In and Out of WebAssembly Modules (01:26:01)

Component Model (01:26:21) https://component-model.bytecodealliance.org/

Interface Types (01:27:52) https://github.com/WebAssembly/interface-types/blob/main/proposals/interface-types/Explainer.md

Mapping Virtual Instruction Sets to Hardware (01:29:05)

Stack Machine (01:29:48) https://en.wikipedia.org/wiki/Stack_machine

Why are Stack Machines Popular for Virtual Machines? (01:30:17)

Spectre and Meltdown (01:31:39) https://meltdownattack.com/ https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)

Branch Prediction (01:33:01) https://en.wikipedia.org/wiki/Branch_predictor

Spectre Variant 2 (01:35:46)

Spectre Variant 4 (01:36:01)

Process Level Isolation (01:36:41) https://en.wikipedia.org/wiki/Process_isolation

Performance Impact of Software Mitigations (01:38:18)

Tradeoffs Between Security and Efficiency (01:38:30)

Decision to Return to Academia (01:40:03)

WebAssembly Research Center (01:40:17) https://www.cs.cmu.edu/wrc/

Carnegie Mellon University (01:40:18) https://www.cs.cmu.edu/

Vision for WebAssembly (01:42:36)

Narrow Waist Architecture (01:43:22) https://www.oilshell.org/cross-ref.html?tag=narrow-waist#narrow-waist

Microkernel (01:45:50) https://en.wikipedia.org/wiki/Microkernel

CHERI (01:46:00) https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/

Transcript

Coming soon.