How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework

Channel:Видео с мероприятий {speach! · Length:49:55 · Published:2016-07-13 · Views:20211

Watch on YouTube

Summary

Armin Ronacher, creator of Flask, explains how CPython's internals and C API leak into the language's semantics. Using examples like the complexity of the add operation, he shows why Python is hard to optimize or reimplement.

Why HN recommends it

It is HN's standard answer to why Python cannot easily get much faster, and is recommended by people who work on JITs and alternative runtimes.

This excellent talk describes how the semantics of the "add" operation are much more complex than generally described. — HN, 2021

Programming language design · Python, Ruby & scripting languages · Software performance & optimization

Subtitles (excerpt)

um so this talk is about python inside the virtual machine and how that actually affects python is a language and because there's a lot of potentially boring stuff in there I would really welcome if people would just ask questions or anything of that sort along the way to spice it up a little bit um what's interesting about I think python as a language is that we all use it and we are sort of we like it I think for the most part at least people don't seem to mind it too much um but it's actually surprising how nitty-gritty uh The Interpreter internally is and how much it sort of restricts Us in in what we can do but also how much it enables Us in other ways um so this is basically um so I should give a little prease for this um I've been doing python since so the first version of python I used was 2.0 but it wasn't like I wasn't programming when 2.0 came out um I think the first one I actually used was 2.2 but I had an interest in trying to figure out how it goes back to to see how um how the language evolved and how The Interpreter evolved um and then just recently I think last year I already gave a talk similar to this one and for that one I decided to see how it is to compile python 1.3 I think so it's

On Hacker News

I thought this presentation by Armin Ronacher (the creator of Flask and Jinja) was very enlightening: How Python was Shaped by leaky Internals(2016): [VIDEO] See also this HN post (Attempts to make Python fast): [LINK] — fault1, 2022-01
I think "a + b" is a good example. I really recommend the talk I linked ( [VIDEO] ), it gets deep into this stuff. I don't think anyone benefits from "a + b" having so many special cases. — haberman, 2021-11
Python is difficult to optimize due to complex language semantics. This excellent talk describes how the semantics of the "add" operation are much more complex than generally described. a+b is not just a.__add__(b), you have to read 200+ lines of CPython interpreter code to fully resolve its semantics: [VIDEO] Not saying it's impossible, but it's more of an uphill battle than optimizing other lan… — haberman, 2021-09
As the OP states: > mutable interpreter frames, global interpreter locks, shared global state, type slots On top of this, Python is extremely dynamic and nothing can be assured without running through the code. So this leads to needing JITs to improve performance which then give a slow start up time and increased complexity. Even with JIT, Python is just not fast thanks to the above issues and it… — arc776, 2020-10
I highly recommend this talk by Armin Ronacher as an accompaniment (or prologue, or epilogue) to the article: "How Python was shaped by leaky internals", [VIDEO] — nerdponx, 2020-09

Related videos