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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Python Meta Circular Interpreter (2019)

47 点作者 leonry5 个月前

3 条评论

upghost5 个月前
Er, to be clear, this just seems to be an interpreter -- not a meta circular interpreter. I don&#x27;t see any evidence that it is able to evaluate its own definitions or its own API. It doesn&#x27;t have any tools to handle class definitions, object instantiation, or method invocation, so I&#x27;m not sure by what definition of &quot;meta circular&quot; this interpreter fits.<p>Not trying to knock the project. Very cool code! Just don&#x27;t understand how it qualifies as a &quot;meta circular&quot;.
评论 #42449966 未加载
评论 #42450149 未加载
albertzeyer5 个月前
In Python, some of the stated use cases, like extracting coverage, extracting the call graph, etc, you can get via tracing already (sys.settrace, <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;sys.html#sys.settrace" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;sys.html#sys.settrace</a>).<p>And I would argue, the other stated use cases are maybe interesting to play around with, but nothing you really would want in production (I suppose).<p>Some of the other use cases, you can also achieve by module import hooks and rewriting the AST. (E.g. see how PyTest rewrites the assertion AST to produce nice error messages: <a href="https:&#x2F;&#x2F;github.com&#x2F;pytest-dev&#x2F;pytest&#x2F;blob&#x2F;main&#x2F;src&#x2F;_pytest&#x2F;assertion&#x2F;rewrite.py">https:&#x2F;&#x2F;github.com&#x2F;pytest-dev&#x2F;pytest&#x2F;blob&#x2F;main&#x2F;src&#x2F;_pytest&#x2F;a...</a>)
评论 #42455185 未加载
评论 #42449694 未加载
albertzeyer5 个月前
Somewhat similar: My PyCPython project (<a href="https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;PyCPython">https:&#x2F;&#x2F;github.com&#x2F;albertz&#x2F;PyCPython</a>), where I wrote a C interpreter in Python, and then tried to interpret CPython. I never really completed this project though.