logoalt Hacker News

zarzavatyesterday at 10:18 PM1 replyview on HN

Just think about what "tests pass" means for a rewrite. If you rewrite from language A to language B then any unit tests have to be rewritten during the rewrite.

So either "tests pass" does not include unit tests or unit tests were rewritten probably by the same AI that is doing the rewrite!


Replies

esprehnyesterday at 11:35 PM

The good part about a language runtime is there's a massive corpus of tests that are in that language and agnostic to the implementation language.

For a JS engine that's Test 262: https://github.com/tc39/test262

For node that's its unit tests which are mostly JS: https://github.com/nodejs/node/tree/main/test

Node also runs the web platform tests too: https://web-platform-tests.org/

Bun has a similar large corpus of JS/TS tests: https://github.com/oven-sh/bun/tree/main/test

You're right about general purpose rewrites, but language runtimes are a lot easier.