Skip to content
0:00 / 0:00

#cpython#flask#arminronacher

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

Видео с мероприятий {speach!

12K subscribers • 1 video on Hallway

YouTube
  • Recommended by 16 people: 15 on Hacker News and 1 on Lobsters.
  • A classic. People kept recommending it from 2017 to 2025.
  • Presented by Armin Ronacher, creator of Flask
  • An opinion. It argues one side of a question engineers disagree on.

Advanced. Deep dive for people who know the field.

20K views10 years ago16 recommendations

Programming languagesSystems programmingPythonCompilers and interpretersPerformance and optimization

Armin Ronacher explains how CPython's internal implementation details and C API leak into Python's semantics, making optimization and alternative runtimes difficult.

The uploader added no description.

Why it's here

16 people recommend this

What people say. Frequently recommended for understanding why Python is difficult to optimize and how CPython's design choices constrain the language.

dbremneron Lobsters • Recommends

How Python was Shaped by leaky Internals (2016)

ericfrederichon Hacker News • Recommends

On “Grumpy: Go running Python”

Python needs a new runtime. This talk shows how bad of shape it's really in. link to this 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

eigenspaceon Hacker News • Recommends

On “JuliaLang: The Ingredients for a Composable Programming Language”

…f 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: link to this 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.…

nerdponxon Hacker News • Recommends

On “Python's Innards: Introduction (2010)”

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", link to this video

arc776on Hacker News • Recommends

On “Attempts to make Python fast”

…sues 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: link to this video link…

habermanon Hacker News • Recommends

On “Writing Python Extensions in Assembly”

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: link to this 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 some…

habermanon Hacker News • Recommends

On “Pyjion – A Python JIT Compiler”

I think "a + b" is a good example. I really recommend the talk I linked ( link to this video ), it gets deep into this stuff. I don't think anyone benefits from "a + b" having so many special cases.

fault1on Hacker News • Recommends

On “Faster CPython (2021) [pdf]”

I thought this presentation by Armin Ronacher (the creator of Flask and Jinja) was very enlightening: How Python was Shaped by leaky Internals(2016): link to this video See also this HN post (Attempts to make Python fast): link

the_dukeon Hacker News • Recommends

On “Grumpy: Go running Python”

Someone else already posted this link: link to this video It explains why CPython can't improve on many things.

dom0on Hacker News • Recommends

On “RTL MJIT – Register transfer language VM and JIT for Ruby”

Instead of typing a long list, I'll just refer you to this talk: link to this video Some of that has been fixed / got make up applied to play pretend.

StefanKarpinskion Hacker News • Recommends

On “My favorite things that are coming with Julia 1.0”

Perhaps the best way to understand what makes Julia fast is to watch these two videos about Python and R and what makes them so hard to optimize: link to this video link Take everything mentioned in these videos that make Python and R really hard to optimize and don't do those things :D

ssivarkon Hacker News • Recommends

On “How Numba and Cython speed up Python code”

There's a reason most high-performance Python libraries are not written that way, and core routines are just written in C instead. Proof of the pudding is in the eating! See this talk by Armin Ronacher (creator of Flask) on why the design of python makes it fundamentally unfriendly to performance optimizations: link to this video Julia has be designed ground up to avoid several such problems. See this discussion: link If your domain falls under the umbrella of numerical and scientific computing, writing Julia is as painless as writing python, with code that automatically runs roughly as fast as C. If you're used to writing numpy, you can hit the ground running in Julia, with maybe a few hours to beco…

ssivarkon Hacker News • Recommends

On “Python Is Eating the World”

…Ronacher 1, 2. Watching that presentation makes me wonder whether I should think of this in the context of "Worse is better". That said, Python's runtime introspection is such a killer feature that it's difficult to explain how empowering it feels for someone who is relatively new to programming. 1: How Python was Shaped by leaky Internals -- link to this video 2: A Python for Future Generations -- link…

ilyagron Hacker News • Recommends

On “Attempts to make Python fast”

I found the following talks by Armin Romacher very informative on these topics (C API, why python is more difficult to speed up than JS). link to this video link I wish these were the things Python 3 addressed, rather than Unicode. I guess it's much more obvious in hindsight than back when Python 3 was designed.

nemothekidon Hacker News • Recommends

On “Node.js 14 is over 20x faster than Python3.8 for fib(n)”

Armin Ronacher, author Flask, actually has a good talk about this. The gist of it the way Python's internals leak into the language makes it very difficult to build a performant JIT that wouldn't break a large amount of userspace code. Python lets you do _far_ more shenanigans that Javascript does; and a lot of large libraries depend on some of that behavior. Breaking it would probably cause a new 2 -> 3 situation. link to this video

eigenspaceon Hacker News • Recommends

On “Is Julia Really Fast?”

Python's classes can change dynamically though during runtime. So each iteration of a loop would need to check if the shape has changed. I'm no Python expert though, so please correct me if I'm mistaken. But it's more than that. There's a really nice talk here from the creator of the Flask framework about a bunch of different semantic choices in the language design, leak out into the ecosystem and make many optimizations impossible: link to this video