TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How the CPython compiler works

112 点作者 r4victor超过 4 年前

4 条评论

xaedes超过 4 年前
I once was interested what exactly happens when executing python code, asking myself questions like &quot;Why can&#x27;t I make a fast for loop? Where are the fast integers? Can&#x27;t I write fast for loop directly in bytecode, akin to asm?&quot;<p>The python bytecode interpreter mainloop can be found in ceval.c. There is a big switch case for each python bytecode opcode starting at <a href="https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;cpython&#x2F;blob&#x2F;master&#x2F;Python&#x2F;ceval.c#L1480" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;cpython&#x2F;blob&#x2F;master&#x2F;Python&#x2F;ceval.c...</a><p>One can see even the simplest operations call quite a lot of stuff. I gave up on fast pure cpython after reading ceval.c...
评论 #24577833 未加载
评论 #24580086 未加载
评论 #24578504 未加载
评论 #24579273 未加载
评论 #24580037 未加载
miguendes超过 4 年前
Great stuff. I&#x27;m very interested in knowing more about python&#x27;s internals. I recently brought Anthony Shawn&#x27;s Cpython internals book but haven&#x27;t read it yet. [1]<p>[1] <a href="https:&#x2F;&#x2F;realpython.com&#x2F;products&#x2F;cpython-internals-book&#x2F;" rel="nofollow">https:&#x2F;&#x2F;realpython.com&#x2F;products&#x2F;cpython-internals-book&#x2F;</a>
评论 #24577645 未加载
r4victor超过 4 年前
Hi! This is the second part of my new Python behind the scenes series that covers the compilation of a Python program. I&#x27;d be glad to hear your thoughts on this part and the series in general.
评论 #24577040 未加载
评论 #24576860 未加载
评论 #24578085 未加载
Rochus超过 4 年前
Interesting, looking forward reading it. I recently bought &quot;Inside The Python Virtual Machine&quot; (see <a href="https:&#x2F;&#x2F;leanpub.com&#x2F;insidethepythonvirtualmachine" rel="nofollow">https:&#x2F;&#x2F;leanpub.com&#x2F;insidethepythonvirtualmachine</a>) which is also recommendable.
评论 #24577204 未加载