Google I/O 2008 - Dalvik Virtual Machine Internals
Google for Developers1 HN recommender · recommended in 1 month, 2012–2018
talk · advanced · 2012–2018 on HN
Dan Bornstein's Google I/O 2008 talk on the internals of Dalvik, the virtual machine that runs Android code. It covers the motivation for its design, the dex format and its register-based interpreter, plus tips for writing code that suits the platform.
HN points to it as the primary source on Dalvik's dex bytecode, register-based design and memory-saving choices.
Up next
13 mo on HNRich Harris - Rethinking reactivity
You Gotta Love Frontend
15 HN recommender · 2019–2026
12 mo on HNLexical Scanning in Go - Rob Pike
GoogleFOSSSydney
13 HN recommender · 2012–2025
12 mo on HNWilliam Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]
PapersWeLove
11 HN recommender · 2017–2026
10 mo on HNCppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
13 HN recommender · 2016–2024
8 mo on HNClasp: Common Lisp using LLVM and C++ for Molecular Metaprogramming
Google TechTalks
8 HN recommender · 2015–2024
7 mo on HNCompiling C to printable x86, to make an executable research paper
suckerpinch
8 HN recommender · 2018–2023
7 mo on HNBreak Me00 The MoVfuscator Turning mov into a soul crushing RE nightmare Christopher Domas
Adrian Crenshaw
6 HN recommender · 2017–2026
7 mo on HNA Talk Near the Future of Python (a.k.a., Dave live-codes a WebAssembly Interpreter)
David Beazley
7 HN recommender · 2019–2025
7 mo on HNMiguel de Icaza: Swift Godot: Fixing the Multi-million dollar mistake #GodotCon2023
Godot Engine
6 HN recommender · 2023–2026
6 mo on HNCppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”
CppCon
7 HN recommender · 2018–2022
5 mo on HNCo-dfns Live Stream: Compiler Design and Architecture
Aaron Hsu (arcfide)
3 HN recommender · 2018–2025
5 mo on HNEric Bier Demonstrates Cedar
Computer History Museum
3 HN recommender · 2020–2025
4 comments from Hacker News
Here's Dan Bornstein's talk at Google I/O 2008 about the dex format and the original Dalvik interpreter: ▶ this video I'm not sure how useful it is in comparing the Dalvik JIT to MonoTouch though.
There's an experimental branch for Ruby: link Dalvik also uses a register-based bytecode. The early versions of Android needed a more efficient interpreter. Dan Bornstein's talk: ▶ this video A classic paper on Register vs Stack VMs: link
This is a great post. I like how they walked through all the steps and especially the "perf" tool. Ruby has a patch to do the same thing -- increase sharing by moving reference counts out of the object itself: Index here: link First post in a long series: link I think these patches or something similar may have made it into Ruby 2.0: link link The Dalvik VM (now replaced by ART) also did this to run on phones with 64 MiB of memory: ▶ this video I think PHP might do it too. It feels like Python should be doing this as well.
I agree: within the Android ecosystem and even within the ARM family, bytecode provides portability: you don't have to compile and distribute apps for different versions of the ARM architecture. It's paradoxical however that to increase the portability of certain types of apps across mobile ecosystems, eg. iOS and Android, and now Ubuntu, your best bet can be to write the portable part in native C or C++, bypassing the Dalvik layer using JNI/NDK. This is apparently the common way to make cross-platform mobile games. On memory consumption: I haven't made any measurements, but the Android .dex bytecode format has been designed with low space requirements in mind. See ▶ this video . However, all apps run in their own VM process, with lots of common structures shared with them using an initial shared VM process and clever forking. I always thought one of the main original motivations to use Java was because it's so well spread among developers. Since in the early days before the JIT compiler, there must have been a really obvious overhead even with the interpreter hand-coded in assembly. But they must have wanted to use a well known higher level language with good IDE support etc. Ubuntu mobile apparently uses Qt: "It uses QML to give you a really slick, easy development experience for native apps with engines in C or C++, and JavaScript for UI glue that isn’t performance critical. We also give you full native OpenGL, which the top games companies are using to make incredible games."