5 ms·
This isn't really a big jump, as they were using AtScript before which was really just a forked TypeScript: https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0
by skrowl 12y ago
This isn't really a big jump, as they were using AtScript before which was really just a forked TypeScript: https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0fQ7KSit97HnZoKVygDxpWzEYW0U/edit https://docs.google.com/document/d/11YUzC-1d0V1-Q3V0fQ7KSit9...
They must have convinced Microsoft to accept their patches into mainline TypeScript.
- Bahamut 12y agoThe TypeScript program manager spoke about this just now at ng-conf (happening now) - their team reached out to the Angular team about this.
- aikah 12y agoNope, AtScript was doing runtime type checking (AtScript is basically traceur with some experimental features) while Typescript DOESNT. To be fair , I don't care, but that's an important precision. It means that the Angular team is giving up on traceur or maybe traceur and typescript will merge somehow in the future.
- skrowl 12y agoOf note, the BRAND NEW TODAY angular website still says it uses AtScript: https://angular.io/docs/js/latest/quickstart.html https://angular.io/docs/js/latest/quickstart.html ES6, AtScript, and the es6-shim AtScript Angular is built with AtScript. AtScript is an extension of ES6 (ECMAScript 6), the new specification of the JavaScript language. This quickstart features AtScript, but you can write Angular in ES5 or ES6 as well. ES6 AtScript compiles to ES6, which is not widely supported in all browsers today. The es6-shim.js file allows you to use ES6 or AtScript in the browser. es6-shim The quickstart repository includes es6-shim.js. The es6-shim.js file includes dependencies (such as Traceur) needed to compile ES6 in the browser. Traceur is an ES6 compiler that transpiles ES6 to ES5 code.
- lars 12y agoI don't see why anyone would want runtime type checking the way AtScript does it. With static typing, the compiler can catch type errors early, at the cost of rejecting some otherwise valid programs. With dynamic typing, that type checking is delayed until execution time. More programs are valid, but type errors are caught late. With AtScript-style late type checking, they took the dynamic type system and introduced more type errors. This decreases the amount of valid programs, yet catches no errors at compile time. It does nothing but increase the amount of bugs.
- nawitus 12y agoYou want both. Compile-time checking is necessary but not sufficient. Applications are not monoliths anymore, and web applications especially will interact with multiple other processes and services. For these you really need dynamic type checking. You can either try to do it in an ad hoc way in the application code, or building the check into the language.
- mintplant 12y agoYou might be interested in this paper. http://www.cs.umd.edu/~aseem/safets.pdf http://www.cs.umd.edu/~aseem/safets.pdf It describes an extension to TypeScript that includes efficient runtime type checking. They encode type information only in situations where checks are necessary, and only information that cannot be otherwise deduced from the context.
- hderms 12y agoare you talking about the typing of data received from outside sources?
- nawitus 12y agoExactly. And even when you receive data from your "own" services that you have type definitions automatically generated for, maybe there's a version mismatch in a deployment somewhere and so on.
- smrtinsert 12y agoCompletely agree 100%. Hopefully Typescript isn't merging any sort of runtime type checking.
- the_gipsy 12y agoI think angular is not after runtime type checking, like the TypeScript compiler. I think what they're after is keeping type information beyond `instanceof`, like keeping information about interfaces and the ability to access type properties beyond `Foo.prototype.bar`. Edit: to clarify, runtime type information should not be used to check for types again, but rather to do things similar to Java's reflection.