Good videos, with context.
How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework

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

Видео с мероприятий {speach!
15 HN recommenders · discussed 2017–2025
Open YouTube ↗

About this video

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 it appears in the archive

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.

AI-generated summary and labels from the source dataset; verify important details against the video. Source & credits.

From the Hacker News discussion

ericfrederich · 2017-01 · strong rec

Python needs a new runtime. This talk shows how bad of shape it's really in. [VIDEO] Basically, the language doesn't have a "spec" per-se. The language is whatever the defacto CPython implementation happens to do within it's giant eval loop. Another great talk about CPython internals: [LINK]

Read original comment ↗
eigenspace · 2020-02 · strong rec

As others have mentioned, Python does have JIT compilers. The problem is that havign a JIT doesn't solve the problem. PyPy is often a factor of 10 behind julia performance and projects like Numba, PyTorch (the PyTorch people had to build their own Python JIT compiler yikes!), etc. will always have a more restricted scope than a project like Julia because Python's very semantics make many optimizations impossible. Here's a great talk from the author of the famous Flask library in Python: [VIDEO] where he discusses the fundamental problems with Python's semantics. If you fix these problems, you will end up changing Python so fundamentaly that you'll really have a new language. Generic CPython 3._ code will certainly not be compatible with it.

Read original comment ↗
nerdponx · 2020-09 · strong rec

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]

Read original comment ↗
arc776 · 2020-10 · strong rec

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's overall dynamism. It can be optimised and for sure there's some impressive attempts at doing so. However I don't think pure Python will ever be considered "fast" as these things necessarily get in the way. I highly recommend the two videos posted here that go into more detail as to why there are limits to how far optimisation can go: [VIDEO] [LINK]

Read original comment ↗
haberman · 2021-09 · strong rec

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 languages that have more regular semantics. Python is also constrained by its C API, which is a very low-level and exposes a lot of implementation details to C extensions. Changing the API could improve performance but it would also make Python incompatible with a large ecosystem of C extensions. I sometimes wish for Python to define a new C API that exposes far less, and to begin a long-term migration towards the new API so that eventually the interpreter would be less constrained. It would be a large migration, but unlike Python 2 -> 3 it wouldn't affect everyday users, only extension authors. I don't know if it will ever happen, but a person can dream.

Read original comment ↗
haberman · 2021-11 · strong rec

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.

Read original comment ↗
fault1 · 2022-01 · strong rec

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]

Read original comment ↗
the_duke · 2017-01 · rec

Someone else already posted this link: [VIDEO] It explains why CPython can't improve on many things.

Read original comment ↗