New Compiler and Moving to GitHub

New Compiler and Moving to GitHub

Rate This
  • Comments 39

Today we’re announcing two changes to the TypeScript project.

Introducing the New Compiler

The first change we’re making to TypeScript is that we’ve been taking a good, hard look at the compiler performance we had with 1.0.  We knew we could leverage the experience from building the original compiler over the last two years.  This led to experimenting with a new, lighter-weight compiler core.  The early results with this new compiler core were so positive that we’re now focused on growing this core into the new TypeScript compiler and language service.

The first stage of this effort is to build a complete standalone compiler based on this new core architecture.  The new compiler follows the same TypeScript 1.0 language spec, has the same compiler flags and compiler functionality, and outputs nearly identical code to the currently shipping TypeScript compiler.  Once complete, the new compiler should be drop-in compatible with the existing one.  The goal here isn't new compiler features, but rather a cleaner compiler architecture that has better performance and allows us to add new features with greater ease in releases to come.

Our work to date on the new compiler has been very promising.  At its current level of completeness, the new compiler is able to compile existing real-world TypeScript code 5x faster than the currently shipping compiler.  These results are still early. Once the compiler has reached parity, we'll be able to report out a more complete picture of the performance improvements.

We have a good start, but there’s a lot of work to do. For the experiment to mature into a full-featured compiler, in addition to making sure the code is robust and correct, we still need to flesh out the following features: 

  • Parser – Strict mode, incremental parsing for the language service (if necessary).
  • Type checking – Get type checker to parity with 1.0 in terms of error coverage.  This is nearing completion.
  • Compiler options – Support for --propagateEnumConstants, --watch, --locale, --logFile and --version. 
  • Language service – Adapt the language service to work with new compiler.
  • Emitter – .d.ts output and comment preservation.

As we reach parity with our existing compiler, we’re looking forward to moving on to ECMAScript 6 features and exploring the top user requests.

If you’d like to help us out, you can find the new compiler at our new TypeScript repository on GitHub, which leads us to change #2.

Moving to GitHub

We’ve heard your feedback, and we’re making the move to GitHub.  We’re continually looking for ways to improve how TypeScript works with the community, and we’re excited about what the move to GitHub could help us do in the coming months.

The new site will work similarly to the current one. 

  • Source code moves to the TypeScript git repository on GitHub
  • Issues move to the TypeScript issues on GitHub
    • Please note: since we’re moving to a new issue tracker and a new codebase, we are not copying all issues over.  If you have issues in the current CodePlex issue tracker, please try them against the new codebase and file them in the GitHub issue tracker if they still repro.
  • Wiki documentation moves to the TypeScript wiki on GitHub
  • Forums will now be more organized. 
    • For questions about how to use TypeScript and how to work with various JavaScript libraries and patterns, please use the TypeScript StackOverflow site.  This helps users have a one-stop place to find the best answers and get started quickly. 
    • For feature requests and design discussions, please post to the TypeScript issues on GitHub 

The blog will continue to be hosted on MSDN and will not change at this time.

Leave a Comment
  • Please add 1 and 3 and type the answer here:
  • Post
  • Does the new compiler untangle the spaghetti in the Emitter class? If so, that's great news!

  • Great to see the project finally moved to GitHub!

  • So basically you are rewriting the compiler for the nth time?

  • Glad to see performance improvements happening again. I love TypeScript, and continue to use it for all my projects, even though compiler performance between 0.9 and 1.0 have been rough.

    I hope the new faster compiler will be a solid base to build on.

  • That sounds absolutely awesome, the only reason I haven't dived in 100% with Typescript is because it would add a compile step - making me slower. I hope that the new compiler makes this step unnoticeable.

  • What great news!

  • I'd be interested to read a blog post about what architecture you guys are using now, vs what you used previously and where mistakes were made and what lessons were learned. It does seem like in the short time this project has been exposed to the public (~2 years), the majority of development time has been spent rewriting and rewriting parts of the compiler to increase performance.

  • Also, are there any actual benefits from moving to Github, other than the fact that it is popular nowadays?

    I see tremendous cost- losing 2 years worth of discussions and issue tracking, not to mention relying on a 3rd party company for your project hosting, yet I see no apparent benefit other than the "its cool" factor.

    Github doesn't seem to let you vote issues up or down- you guys have been pretty forthright in saying that the vote count on issues has influenced your design discussions. What alternative to voting on issues have you come up with to justify the move to Github?

  • Like MgSm88 I would be interested in learning more about what kind of changes can bring a 5x times improvement.

    I would also like to know what you think of Javascript as a language for building complex software such as a compiler. What do you think would be different if you choose otherwise -- e.g. if you had used the same foundation as the Roslyn compilers?

  • @MgSm88 GitHub is a better fit for TypeScript for a couple reasons.  Like you mention there's a large developer community on GitHub, and by participating as part of GitHub we can work more closely with that community.  We're also taking the opportunity to simplify our process.  On GitHub, the issues we're tracking will be the official issues and the team will be able to work more closely with users on repros.  This will make it more transparent to see what is fixed and when.

  • I applaud the move to GitHub. That's a great decision and will make the developers' lives both more enjoyable, and work being done more productive. As GitHub makes their product better, everyone will automatically benefit. Good decision!

  • Amazing news, I had a quick look to the new sources and it seems quite lightweight compared to the old one.

    Looking forward to the result.

  • Great news.  TypeScript will take over!!! :)

  • How about removing all statics from the compiler so it can be run as a compiler server, so it can stay "hot" and in the significantly faster "long-running" path of the JavaScript JIT?

  • Thank you team!

Page 1 of 3 (39 items) 123