Beyond Native Code: Python, JVM, .NET, and WebAssembly Bytecode
A bytecode file is a program plus the compiler's notes about it, and this lesson builds the readers that show which notes each container keeps.
150 minutesBuildPython, Java, C#, WebAssembly textMembers
Learning Objectives
- Read the 16-byte
.pycheader from PEP 552 and unmarshal the code object without themarshalmodule, for files written by four interpreter versions. - Parse a JVM class file from JVMS Chapter 4: constant pool, fields, methods, the
Codeattribute, and the tables thatjavac -gadds. - Disassemble the JVM opcodes in
Ledger.classand prove the listing againstjavap -con four builds of the same source. - Read a WebAssembly module section by section, decode every function body, and prove the result against
wasm-objdump -d. - Walk the ECMA-335 metadata of a .NET assembly from the PE data directory to the
MethodDefrows and the CIL of each method, checked against the reader library that ILSpy uses. - Measure, for one function in five containers, which names, types, and control structure each format keeps and which it loses.