Circular TS→JS→TS→JS transpiling yields impressive results
Transpiling is a popular approach in modern JavaScript ecosystem. TypeScript, ClojureScript, CoffeeScript, Elm and other languages are compiled to JavaScript because, for the most part, JS is still the only language native to the browser.
Today, a new opportunity is being considered by front end experts. Unexpectedly, TypeScript-to-JavaScript-to-TypeScript-to-JavaScript transpiling yields better performance and better code quality, essentially for free.
Nobody expected this, but if you think about it, it makes sense. Average front end code quality is so low, that simple one way transpiling improves both performance and readability. Then, traspile code back into source language, contemplate its beauty, and transpile again into target JS. Surprisingly, it improves again.
The research shows that in theory improvements never stop, but there's an asymptotic ceiling, so in practice it makes sense to loop the transpilation 3 to 5 times.
Browser vendors are considering taking advantage of multicore architecture and allow websites to provide a desirable amount of transpiling loops via new script tag parameters.