logoalt Hacker News

Formalizing CPython

112 points • by carnevalem • today at 1:56 AM • 48 comments • view on HN

Comments

debugnik • today at 10:04 AM

Wouldn't it be more productive spending the tokens on adding ACSL annotations to verify CPython with Frama-C? You'd verify the actual runtime instead of an AI translation of it, and fixes could be contributed upstream directly.

anewhnaccount2 • today at 5:06 AM

Same approach for Julias stdlib: https://discourse.julialang.org/t/formalizing-julia-in-lean-...

➕ show 1 reply
jakobnissen • today at 6:01 AM

I think this approach to bug hunting is super promising (obviously - it finds a ton of bugs). The long-term problem is how this kind of bug-hunting can be done routinely, e.g. as part of a test suite. The approach taken by these people, the same approach as when the Julia folks did it, isn't really automatable, because it requires a lot of both human and AI agent work.

I guess longer term it needs to be built into the language, to prevent code and lean proofs from drifting. I.e. it could be opt-in properties that are written along the code, and which is then checked in the test suite. So very similar to ordinary compiler checks, except more expressive and expensive, and done only at test time.

➕ show 4 replies
erfgh • today at 8:38 AM

Does anyone read articles written by AI? This is a serious question.

➕ show 2 replies
tomtom1337 • today at 10:25 AM

I'm confused about a few points, would love it if someone could help clear it up!

- if the rewrite in Lean happens line-by-line, how can the two implementations differ in their result (Step 2)?

- how does this approach know "something that should always be true" in Step 3 (is it the intelligence of the LLM "guessing"?).

➕ show 3 replies
bb88 • today at 6:27 AM

Only 418?

I would have expected around 10k.

Edit: Professional python programmer.

➕ show 1 reply
eternauta3k • today at 6:32 AM

Is there a way to avoid the translation or replace it with normal parsing?

➕ show 1 reply
actionfromafar • today at 9:21 AM

Stupid question: if the lean4 code is a copy of the C code, how does "it" know which code is a bug and which code is working as intended?

➕ show 1 reply
woggy • today at 6:47 AM

Can we just develop in Lean and compile to something else for speed?

➕ show 2 replies
yksalun • today at 7:14 AM

[flagged]

Hyorinmaru • today at 8:17 AM

[flagged]

senderista • today at 6:43 AM

Cite an AI-written document? Hell no.

q4y2u35uk • today at 5:01 AM

[flagged]

➕ show 2 replies
fny • today at 5:03 AM

[flagged]

➕ show 2 replies
up2isomorphism • today at 5:55 AM

[flagged]