Hear that? I think someone just fired the first shot in a new battle about to ensue in the front-end space theatre…
Earlier today I noticed HackerNews posted a link to the AtScript Primer, a draft document authored by Misko Hevery & Rob Eisenberg. If you don’t know who those people are, you should as they have a lot of influence in this space (and something like this would likely be dismissed if it was by another random person). Misko is the father of AngularJS and Rob is the father of Caliburn.Micro (an MVVM framework for XAML based languages) and DurandalJS, an alternative to AngularJS.
So what is AtScript? As stated on their draft document:
Sound familiar? Yeah… I thought so too… this is taken from the first paragraph of the TypeScript 1.0 language spec (published April 2014):
Misko & Rob said in the draft document that their plan is to use AtScript to build Angular & make it easy for developers to use AtScript to build Angular applications. AtScript will be independent of Angular and can be used in non-Angular projects.
They actually addressed this… what’s wrong with TypeScript? From their point of view, TypeScript’s types are only analysed statically which makes it challenging to have optional types. While TypeScript does have type inference, they take the position that it has limits. Static typing also cannot be used to assert data returned form the server as JSON has valid structure.
In addition, AtScript will have two things that TypeScript does not currently have:
- TypeScript lacks metadata
- TypeScript does not provide a way to access annotations at runtime
Will AtScript be a competing thing with TypeScript? It doesn’t appear so… one picture shown implies that AtScript is a superset of TypeScript. TypeScript is a superset of ES5 today and Microsoft is working to make it a superset of ES6 (when it’s finalized). Misko said as much in his presentation (see video below).
Today Misko said they currently have an AtScript compiler running on top of traceur (similar to TypeScript’s compiler, it’s a transpiler that can generate ES5 from ES6) that consumes a
*.ats file and can generate a
This will be interesting to see evolve… need input!