3 ms·
> Wouldn't it make more sense for some of these features to be implemented as a desugaring step in the runtime itself? I think if it was that simple, it would
by gary_0 2y ago
> Wouldn't it make more sense for some of these features to be implemented as a desugaring step in the runtime itself?
I think if it was that simple, it would be done that way already (maybe it is, for some features). Two big arguments for doing the "desugaring" offline are the (1) speed, and (2) security of the browser. Those two things also conflict somewhat if addressed on the client, since faster but more complex compiler code increases the surface area for potential exploits.
But if you do this compile step offline, you don't need to worry about compromising the performance or security of the browser.