logoalt Hacker News

nine_kyesterday at 10:28 PM4 repliesview on HN

"We rewrote this code from language L to language M, and the result is better!" No wonder: it was a chance to rectify everything that was tangled or crooked, avoid every known bad decision, and apply newly-invented better approaches.

So this holds even for L = M. The speedup is not in the language, but in the rewriting and rethinking.


Replies

MiddleEndianyesterday at 10:33 PM

Now they just need a third party who's never seen the original to rewrite their TypeScript solution in Rust for even more gains.

show 1 reply
azakaiyesterday at 11:49 PM

You're generally right - rewrites let you improve the code - but they do have an actual reason the new language was better: avoiding copies on the boundary.

They say they measured that cost, and it was most of the runtime in the old version (though they don't give exact numbers). That cost does not exist at all in the new version, simply because of the language.

baranulyesterday at 10:59 PM

Truth. You can see improvement, even rewriting code in the same language.

awesome_dudetoday at 1:25 AM

I think that they were honest about that to a degree, they pointed out that one source of the speed up was caused by the python fixing a big they hadn't noticed in the C++

Edit: fixed phone typos