12 ms·
AtScript Primer
- timeu 12y agoThis is used for the new AngularJS 2.0
- skrebbel 12y agoI'm really interested in this. Does anyone know if this has a publicly available compiler already?
- svckr 12y agoFrom the "Current Status" section: Currently we are in the midst of writing Angular v2 on top of the AtScript syntax. Here is an inventory of what is working today: - Traceur transpiler: - Consumes the AtScript syntax. (type annotations, meta-data annotations, fields) - Generates ES5 code with runtime type assertion statements for the rtts library and with meta-data annotations. - Transpiles AtScript into Dart code. (Does not do semantics matching, requires developer to use facades) - RTTS Library: - Asserts nominal types. - Asserts structural or custom types. - Partial support for generics. Generics support in arrays and maps only.
- ganarajpr 12y agoI would be interested in knowing where the RTTS library is ( source-code ).
- ganarajpr 12y agoFWIW, I believe they are using traceur-compiler. https://github.com/google/traceur-compiler https://github.com/google/traceur-compiler If you look at this page here https://github.com/google/traceur-compiler/wiki/LanguageFeatures https://github.com/google/traceur-compiler/wiki/LanguageFeat... You can see annotations in the "experimental" features list.
- temperbens 12y agohttps://github.com/support11/discussions/wiki/Watch-QPR-vs-Aston-Villa-live-stream-free https://github.com/support11/discussions/wiki/Watch-QPR-vs-A...
- temperbens 12y agohttps://github.com/support11/discussions/wiki/QPR-vs-Aston-Villa-live-stream https://github.com/support11/discussions/wiki/QPR-vs-Aston-V...
- svckr 12y agoThanks for the link. At [ngeurope](ngeurope.org) Miško pointed out that they we're specifically not aiming to create yet-another-language. Instead they are evaluating ways for JS to evolve beyond ES6 and are planning to propose AtScripts features for ES7 (or whatever is next). This falls in line with the recent trend that new features start out in transpilers instead of browsers.
- ceronman 12y agoI really like the idea of static type checking, but I'm not convinced about the usefulness of runtime checking. It will introduce a performance penalty and it will go against duck typing, which is one of the coolest features of languages like JS. It seems that this project is trying to build something in between of TypeScript and Dart: they want the optional runtime type checking of Dart vs the good interoperability with JS of TypeScript. In this interview [1] Anders Hejlsberg and Lars Bak (from TypeScript and Dart) discuss the idea of runtime type checking. They don't seem very convinced of the idea either. [1] https://www.youtube.com/watch?v=5AqbCQuK0gM https://www.youtube.com/watch?v=5AqbCQuK0gM
- grandalf 12y agoEverything quacks like an object!
- nawitus 12y agoThe link states that you can "disable" the type checking for production use. I wonder if there's still a slight performance penalty. Atleast my "toy" project for runtime type checking has that slight performance penalty even when it's disabled: https://github.com/panuhorsmalahti/typed-javascript https://github.com/panuhorsmalahti/typed-javascript
- malandrew 12y agoThanks for the link. That's an interesting approach that I hadn't considered. Would be nice to see it also support checking the return types and higher-order functions.
- zackbrown 12y agoAs I understand it, there is a 'production mode' that disables the runtime type checking. This way developers can gain the development-time benefits of type safety without sacrificing performance where it counts. As for the benefits of duck typing, also as I understand it, the key point of runtime vs static checking is that it eases interoperation with non-annotated and non-typed code. So duck-type if and when you want; reap the benefits of types when you want. For a much better explanation, watch Misko Hevery's keynote about Angular 2 and AtScript from NgEurope yesterday: http://youtu.be/S8fE-w2DL8U?t=21m5s http://youtu.be/S8fE-w2DL8U?t=21m5s
- davidgrenier 12y agoPersonally glad to be free of all that goofiness, Angular, JS or what have you. http://websharper.com/ http://websharper.com/ Almost two years in production. I even had the opportunity to try the F# Type Provider for Sencha Architect and although I do not like tooling I came away shocked at how productive the experience could be for back-end application development using that tool.
- ep103 12y agoWhat's it do, just compiles to js for the front end?
- davidgrenier 12y agoCompiles your client-side F# code to JS such that you write all your code in the same programming language. You get to leverage the sophisticated type system of F# for your client side code and get transparent interop between front-end and back-end code. There's no need for http/ajax requests to your back-end code because the WebSharper compiler takes care of wiring function calls from the client side directly. [<RPC>] let getName() = "David" [<JavaScript>] module Client = let page() = Div [ Span [Text (getName())] ] Not only is all of this statically typed, WebSharper takes care of transparently wiring the call for you and serializes any data structure that you may want to pass from the server to the client and vice versa. WebSharper has no problem generating both server-side markup through server-side combinators but truly reigns as a SPA architecture as you can choose to simply return data from your RPC calls and generate the markup on the client-side. Another benefit here is that you generally avoid the need to rely on libraries like JQuery to query your DOM and interact with the markup. Being able to simply keep a reference to any DOM element you create as opposed to having to query your DOM to get is just simpler. But WebSharper also offer a host of well thought-out abstractions on top of Web Development in the form of Sitelets/Formlets/Piglets and now UI.Next. The real benefit of those is composability. If you are are already familiar with an ML-like language you will be pleased at the benefits you get. If you aren't, I strongly recommend you take a look at the landscape of programming languages as three great families stand out... you would do yourself a major favor as a developer to learn at least one ML. Those that do never go back.
- santialbo 12y agoI was very excited when Facebook showed flow at @scale but I haven't heard any update on the project since. Does anyone know when they are planning on releasing it?
- striking 12y agoUnfortunately it seems to me that the Google Drive folder linked is inaccessible.. the individual documents are easily found via Google Search but seeing them all in one place would be kinda nice.
- malandrew 12y agoWhy not use type annotations to accomplish this? Do we really need another compile to JavaScript language for something that did not require changing the language syntax? There is no reason that a similar project could not have been made via smaller modules using comment annotations. This project really should be at least two projets: (1) one npm module for parsing the type signatures with the line numbers of the functions it applies to. (2) one module that takes in that intermediary representation and performs the AST transform for wrapping the functions. I don't see why this couldn't have been accomplished with: (1) the doctrine module [0] for parsing JSDoc comment blocks before functions OR a custom module for recognizing a custom comment delimiter like //+ or //! followed by the type annotation such as Haskell's type declaration format. (2) a module for parsing closure compiler JSDoc type signatures (3) the racket-style higher order contracts module [1] for a way to do run-time checking (3) a module consisting of all the possible permutations of higher order type checking functions based on rho-contracts (4) the node-falafel module [2] for performing the actual AST transform that wraps those contract functions around the function described by the JSdoc comment. Furthermore, this approach of breaking this up in to modules allows multiple people to propose alternative syntaxes for this for consideration in future versions of ECMAScript. I wouldn't be surprised if sweet.js could also be used for those syntax approaches that go beyond comment-based annotations and involve modifying the syntax of the language itself. For those that built this at Google, please please please consider breaking this down into smaller composable modules. I'd love to be able to play with the subcomponents of this myself without having to adopt yet another language that doesn't parse with off the shelf tools [4]. [0] https://github.com/Constellation/doctrine https://github.com/Constellation/doctrine [1] https://github.com/sefaira/rho-contracts.js https://github.com/sefaira/rho-contracts.js [2] https://github.com/substack/node-falafel https://github.com/substack/node-falafel [3] http://sweetjs.org/ http://sweetjs.org/ [4] See JSX for the clusterfuck[6] that results when you add yet another format that needs to be parsed in a unique way with no real benefit that couldn't be accomplished just as easily without fucking with the standard language syntax. See Wadler's Law [5] [5] http://www.haskell.org/haskellwiki/Wadler's_Law http://www.haskell.org/haskellwiki/Wadler's_Law [6] https://www.npmjs.org/package/esprima-fb https://www.npmjs.org/package/esprima-fb
- 12y ago
- ep103 12y agoIs anyone else simply getting tired of the number of ways google is attempting to (in their words) "replace JavaScript as the lingua franca of web development on the open web platform"? Dart, Angular, and AtScript are just the three most recent iterations of completely overhauling js for and by Google.
- dragonwriter 12y agoNo. I appreciate Google (and others) trying to make things better without breaking what works now. Also, only Dart and AtScript are attempts to overhaul/replace JS, Angular is just a library (with versions for JS and Dart), not attempt to overhaul JS.
- malandrew 12y agoThis isn't entirely accurate. They aren't breaking what works in the browser, but they are breaking lots of the toolchains developers already use. I would much more appreciate these efforts if they started from a position of trying to do as much as possible in a way that is compatible with the existing development tooling and then building their incompatible extensions on top of that tooling.
- dragonwriter 12y ago> They aren't breaking what works in the browser, but they are breaking lots of the toolchains developers already use. How? I mean, if they deleted JS from Chrome in favor of Dart (but not AtScript, which is a JS superset) it might break toolchains that developers use, but making Dart (with dart2js) and AtScript available doesn't break anything.
- georgemcbay 12y agoNo, I'm getting tired of other parties (most notably Mozilla) doing whatever they can to block such efforts on political rather than technical merits. Do we really want to be stuck with a mostly stagnant JavaScript forever? Ugh.
- rikkus 12y ago"The goal of AtScript is to enhance the language with these missing features without infringing upon its current capabilities." Looks like they decided TypeScript was Not Invented Here?
- dmethvin 12y agoTypeScript compiles out all the overhead, AtScript will need to leave at least some overhead so that it can support RTTI. The AtScript design acknowledges and borrows from TypeScript, ideally I would prefer it to be a superset so we don't end up with a lot of divergent dialects.
- munificent 12y agoAccording this [1] article from Microsoft, the TypeScript folks are coordinating with the AtScript folks. [1]: http://blogs.msdn.com/b/typescript/archive/2014/10/22/typescript-and-the-road-to-2-0.aspx http://blogs.msdn.com/b/typescript/archive/2014/10/22/typesc...
- robbrown451 12y agoLooks to me like they are embracing Typescript. This is basically a superset. If I was on the Typescript team, I'd consider it a victory.
- jbergens 12y agoIf you watch the keynote video about AtScript you'll see that they describe AtScript as a superset of TypeScript 2. They add features they think are missing but are trying to keep the syntax wherever possible (actually they hope that much of TypeScript will be in a future EcmaScript standard and then they will follow that syntax).
- danabramov 12y agoI like the parts before DI. TypeScript-ish syntax, pluggable runtime checks—I really like that. But DI and annotations speak more of Angular's complexity than anything.
- muyuu 12y agoAnother TypeScript or another Dart? http://xkcd.com/927/ http://xkcd.com/927/
- ep103 12y agoIf google is going to attempt to use angular to get developers to use this (as opposed to just letting it fail naturally, like Dart), then I'm done using angular.
- mentaat 12y agothis begs the question why not just use dart (esp. since its from google as well).
- paperstreet7 12y agoIt seems to me they're trying to use the popularity of Angular.js to bring AtScript on the scene. Everyone who doesn't like JS tries to replace it with his own language or at least fix it. There are tons of different compilers that hide real JS from their eyes behind language x but when it comes to realtime debugging they inevitably have to dig into some real JavaScript generated by those tools. AtScript is not an exception here.