Why Microsoft didn't have LLMs do their recent Typescript native rewrite in Go
@ryanlpeterman30K followers
84,913 views
35 Comments
Comments from the original post on X (Twitter)

@enrub_en
"You can't really trust that it's going to do the same thing twice" When you are truly aware of this, is the first big step to learn to use it properly
22 likes

@samwhoo
Completely agree. Had the same problem porting chunks of Kubernetes to TypeScript for Ultimately it’s very difficult to know for sure the code is correct without carefully reading it.
11 likes

@jordanhenderson
100% perfect test coverage is a hallucination. It doesn't test your assumptions in the design. “Program testing can be used to show the presence of bugs, but never to show their absence!” ― Edsger W. Dijkstra
10 likes

@IamPaulLuo
I think 90% if the people talking AI don't understand what none deterministic means.
9 likes

@wackie
i think they would have if they had fable/sol class models at the time. see: bun zig -> rust
6 likes

@Jamestjsp
Btw, bun was rewritten in 11 days
5 likes

@alexlavaee
I'm a Research Engineer at Microsoft Research. You still have to know what good looks like. You can parallelize the verification around that. If you want an example of how to encode verification automatically you can refer to OSS Atomic (bastani-inc/atomic) on Github. It's a verifiable coding agent runtime that comes with builtin verification primitives. It's used for complex tasks and we've measured conservatively about 1.5 hrs less time to verify each task. Sharing in case it's useful for others to have a real world example on how to encode verification that's already in production use.
4 likes

@FpeSre
Determinism is not the real hurdle here, type theory semantic mapping is. Compilers are abstract syntax tree transforms where JS structural typing, prototype chains, and tricky union narrowing have zero direct 1:1 idioms in Go interfaces. Writing a meta transpiler just isolates the translation rules, but human engineers still have to design the underlying memory layout. You cannot automate architecture decisions you have not formalized yet.
2 likes

@JaapFrolich
@BrendanEich Ngmi
2 likes

@spion
I'm not sure on this one, the main thing AI is really good at is porting from one language to another. The programs encode perfect specs about desired behavior, an the AI knows a lot about language idiosyncracies already to detect subtle behavior drift for naive translation.
1 like

@RiyAdh125243
Brilliant methodology
1 like

@RDistinct
the compiler port from ts to go was something very unique, something ai doesnt have experience with. Also he said that they tried it but it didnt work as expected.
1 like

@CFDevelop
Regardless of how the code is written, tonnes of tests are needed. The main task here is converting the test corpus to Go. The actual code SHOULD be far less important because the tests should have mutation testing to guarantee correctness of the code
1 like

@AlexRebula
What a great podcast! Wow! I did not imagine I would hear so much behind-the-scenes and history about so many of the languages I've worked since high-school! And I don't remember when was the last time someone mentioning Turbo Pascal we used to learn programming in 1996! 🙂
1 like

@rusabuilds
a port needs to produce identical output on the existing test suite, and a model that improvises will quietly change behaviour in the cases nobody tested. for a compiler that is fatal, so a mechanical line by line rewrite is the correct boring choice.

@Farooq_AI
Spot on. Park the randomness in the build step, get deterministic output every run. Same principle we apply when building AI tooling for financial systems.

@rusabuilds
hejlsberg's point is underrated. a line-by-line port preserves the original's structural decisions, which is exactly what you don't want when the language changed

@riasat
Behind times. Bun leads the way

@pscottdv
LLMs can be completely deterministic. What's he on about?

@longkingchiang
Nice!















