YoVDO

Exploring CPython's Bytecode

Offered By: EuroPython Conference via YouTube

Tags

EuroPython Courses Code Optimization Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Dive into the inner workings of CPython's bytecode in this 50-minute EuroPython Conference talk. Explore the compilation process, virtual machine execution, and bytecode structure. Unravel the mysteries of .pyc files, code objects, and the disassembler. Learn how to compile your own code objects and gain insights into bytecode arguments and the evaluation loop. Examine various bytecode instructions, including LOAD_FAST, BINARY_MULTIPLY, and CALL_FUNCTION. Discover techniques for abusing bytecode and improving tracing. Gain a deeper understanding of Python's internals and enhance your programming skills through this comprehensive exploration of CPython's bytecode mechanics.

Syllabus

Intro
Unravelling Bytecode
Python: Compiler & VM
Python overview
Example Module
Executing the Bytecode
Optimisation
Structure of .pyc Files
Magic Number
Timestamp
Code Object Marshal module
Back to the Compiler Compile your own code object
Code Objects It's documented: Data model (Language Reference) Everything which is executed becomes a code
sum Code Object
Disassembler
First Taste of Bytecode (2) LOAD FAST
First Model of the VM
Reading Bytecode
Bytecode Arguments dis HAVE ARGUMENT = 90
First Eval Loop
Passing Arguments
Handling Bytecodes
LOAD FAST LOAD CONST
BINARY MULTIPLY
BINARY ADD
RETURN VALUE
The VM So Far
Disassembling the Module
STORE NAME LOAD NAME
CALL FUNCTION (2)
POP JUMP_IF_FALSE
JUMP FORWARD . POP TOP
Incomplete
EXTENDED ARG
Abusing Bytecode
The Tools
Improve Tracing
Questions


Taught by

EuroPython Conference

Related Courses

A Brief History of Data Storage
EuroPython Conference via YouTube
Breaking the Stereotype - Evolution & Persistence of Gender Bias in Tech
EuroPython Conference via YouTube
We Can Get More from Spatial, GIS, and Public Domain Datasets
EuroPython Conference via YouTube
Using NLP to Detect Knots in Protein Structures
EuroPython Conference via YouTube
The Challenges of Doing Infra-As-Code Without "The Cloud"
EuroPython Conference via YouTube