Native TypeScript engine in browser

Topics: General
Oct 10, 2012 at 3:42 AM
Edited Oct 10, 2012 at 3:44 AM

Do you plan to support native (without intermediate javascript) TypeScript engine or VM like Google Dart VM in Chromium?

Oct 10, 2012 at 3:48 PM

TypeScript's purpose is for creating and working with JavaScript.  That's what it was designed from the ground up for, and it's our main focus.

Oct 10, 2012 at 10:46 PM

It occurs to me there's an opportunity here: could you add meta-data to TS generated objects (e.g., via some specially named field) which could be identified by a TS-aware JS compiler?  Once you have strong type information, your compiler can be simpler, will have more optimisations available, and can generate better code.

[I spent over a decade working on the Mercury compiler and I couldn't believe the optimisation opportunities that were sacrificed to support OO languages.  Then JavaScript came along which was ten times worse again...  But I digress.]

Apr 17, 2015 at 8:39 PM
I've had the same thought. Since valid JavaScript is valid TypeScript, then technically, your native browser JIT engine could just be a TypeScript engine. A person could, of course, easily compile to both, and a browser with TypeScript support would perform much better because of strong typing.

I feel like this is the logical future.