13 ms·
Announcing TypeScript 1.0
- egeozcan 13y agoAm I really missing it or are they announcing a new version with no release notes? edit: it seems that they had them in the blog post for the release candidate http://blogs.msdn.com/b/typescript/archive/2014/02/25/announcing-typescript-1-0rc.aspx http://blogs.msdn.com/b/typescript/archive/2014/02/25/announ...
- shadowmint 13y agoThere are a few little new things, but 1.0 is essentially bugfixes from the 0.98 release which was essentially feature complete. New things (eg async) are further away on the roadmap: http://typescript.codeplex.com/wikipage?title=Roadmap http://typescript.codeplex.com/wikipage?title=Roadmap
- pingec 13y agoedit: The talk has ended now. Will update if I find a link to that talk. Anders talking about TypeScript live: http://channel9.msdn.com/ http://channel9.msdn.com/
- BlackMonday 13y agohttp://video.ch9.ms/sessions/build/2014/3-576_LG.mp4 http://video.ch9.ms/sessions/build/2014/3-576_LG.mp4
- dewiz 13y agotypescript at stackoverflow http://stackoverflow.com/questions/tagged/typescript http://stackoverflow.com/questions/tagged/typescript
- bsaul 13y agoThis project really is the greatest thing that could happen in computer science : a great mind trying to solve a problem in the most pragmatic yet elegant way to achieve the greatest possible benefit for developper with th minimal amount of time and work.
- keithwarren 13y agoA little strong on hyperbole. Less Flair version - Happy to see a well know and respected computer scientist trying to solve a problem faced by lots of developers and doing it in a simple and easy to understand way.
- bsaul 13y agoAgree. I wanted to put some emphasis on the fact that technologies with modest goals, but well executed, may in fact achieve more than grand masterplans. After more than 15 years of coding I came to realize that focusing very strongly to your true needs and nothing more, is really a quality met only by the very advanced.
- xster 13y agoDart already happened
- toggle 13y agoIt'd be great if there was a compiler that would compile TypeScript to asm.js [0]. Adding type-safety in TypeScript is only for the programmer -- when you compile it to Javascript, you don't get any performance increase. But, if you could compile it to asm.js, you'd actually get some performance increase out of it. (Note: I don't know much about TypeScript or asm.js, so if what I just said is completely untrue, I'd love to know why.) [0]: http://asmjs.org/ http://asmjs.org/
- Touche 13y agoasm.js requires you to manage your own memory. TypesScript doesn't, it's a pretty thin layer on top of JavaScript.
- fractalsea 13y agoCare to explain why? To my understanding asm.js is a restricted subset of JS that allows for optimisations to be performed that would not otherwise be possible. In a similar way to how Java bytecode can be interpreted more efficiently compared to a non-compiled language, like Python. With that in mind, sure you could target asm.js with a high level language that requires memory management, but why couldn't you also target it with a language that assumes GC. JS interpreters have this GC component built in already. Essentially I don't see how it is different from Java + Java bytecode + the JVM, which does perform GC. I'm very curious about this.
- RazvanPanda 13y agoTypeScript IRC channel: irc://irc.freenode.net/#typescript
- girvo 13y agoAnders is my favourite language designer, ever :) TypeScript is something I'm still trying to get more buy-in from my team, but the issue is the lack of decent autocomplete/static analysis in anything other than Visual Studio. I'm working on that problem myself, actually.
- paf31 13y agoI use Cats IDE on a relatively large project and find it very good.
- chadzawistowski 13y agoIntelliJ supports TypeScript! http://www.jetbrains.com/idea/webhelp/typescript-support.html http://www.jetbrains.com/idea/webhelp/typescript-support.htm...
- DCoder 13y agoFrom past experience, their support is good, but one significant thing I missed was type inference: // function signature getNumber(context: any, callback: (result: Number) => void); // calling that function // unfortunately, here the type of num is any // unless I specify it manually getNumber(..., (num) => { ... }); Visual Studio figured out the type on its own.
- keyle 13y agoI am huge believer in typescript. This has made me consider html5 seriously for the first time. There are still many dark spots (hello js scope, bs standards), but with Typescript I've already built stuff I could have only done AIR in the past. I find it ironic that MSFT tried to compete with Flash with Silverlight (and failed I think), and to me, Typescript means end of the line for Flash/AS3. The language is dead easy to pick up, and IntelliJ has been a really good IDE with it. Highly recommended.
- ossreality 13y agoHuh? It just transpiles into JS...
- bprater 13y agoThe article is light on 'What is Typescript'. Can someone explain what TypeScript is?
- lmkg 13y agoIt's a compile-to-JavaScript language, like CoffeeScript. Differentiating features: - Strict superset of JS. All(?) JS is valid TS, making it easier to migrate to TS. - Many of the added features are from EcmaScript 6, i.e. JavaScript Of The Future. TS lets you use those today, instead of waiting for browsers to implement. - (Optional) type system, which some people are fans of. - Much stronger tooling & IDE support, in part due to the typing.
- mfn 13y agoAlso, compiling down to human-readable and well formatted JS has always been a priority. So it's never difficult to migrate away from typescript, since the typescript can simply be replaced by the compiler's javascript output. IIRC, this is actually one of the main reasons they're holding off on implementing async/await, since that would require the compiler to convert functions into unreadable state machines.
- elpool2 13y agoAnother feature that's not talked about much is its support for AMD and CommonJS modules. So you can easily just add an "import moduleName = require('my/module/path');" to the top of your typescript file. And you'll get full intellisense and type-checking on the referenced module in Visual Studio. This alone has made it worth using for me.
- nawitus 13y agoNot all valid JavaScript is valid TypeScript, e.g. you can't use undeclared variables. The compiler can still output the .js file, though.
- ternaryoperator 13y agoTypeScript also adds namespaces.
- silentrob 13y agoI was really hoping it would have a lib style compile api, but it seems fairly locked down. :(
- jbm 13y agoCould someone be so kind as to explain why I should consider Typescript over Coffeescript in future projects? I've been using CS for the past year or two, but I'm hearing a lot of buzz around TS for the past few months. It would be really nice to have a better idea as to why it should be best to move now - is it really that much better? (I love the CS tools available on PyCharm; they really made my life easier. That said, I think that there are similar TS tools available as well)
- pekk 13y agoMaybe I'm just waiting for TypeCoffeeScript ;)
- jbeja 13y agoThere is actualy one already: https://www.npmjs.org/package/typed-coffee-script https://www.npmjs.org/package/typed-coffee-script
- mahmud 13y agoCoffee is to Type Script what indentation is to type theory.
- jbeja 13y agoTypescript is just a superset of JS, what does that mean? Is just your regular js, but with some stuff added like type check, classes, interfaces and some cute operators, just the language that most know with some goodies added to help with development, that is and that all, in oppose to CS that is just syntatic sugar with others cute tricks that make the language more appealing to people like you (assuming by your post that you are a python developer). So if you are into JS or type check then you should give TS a try, if not then just stick with CS, only you can answer is changing transpiler in your workflow is gonna make your life easier.
- untog 13y agoOne reason (as I see it) is that TypeScript is implementing ES6 features along with the type-specifc stuff, so it's going to end up in a place where it's very compatible with the 'future' of JavaScript. CoffeeScript will always be something quite different. I love it, but that difference makes me nervous. ES6 ought to bring a lot of the features I like about CoffeeScript into JavaScript.
- bilalhusain 13y agoThe typescript playground[1], which lets you try TypeScript in your browser, looks so professional and finished when compared to CoffeeScript[2] or Dart[3]. As someone who attempted a half-baked Rust to JavaScript transpiler[4], I am floored with the packaging of TypeScript (tutorials, specs, editor integrations, npm, playground). At the moment, the only missing feature that my jealousy could point out is autoscrolling (see lexer example in my demo)! By the way, is playground using v1.0? [1] http://www.typescriptlang.org/Playground/ http://www.typescriptlang.org/Playground/ [2] http://coffeescript.org/ http://coffeescript.org/ (Try CoffeeScript tab) [3] http://try.dartlang.org/ http://try.dartlang.org/ [4] http://bilalhusain.com/rust-lexer/syntax.html http://bilalhusain.com/rust-lexer/syntax.html
- couchand 13y agoI don't think any of them are very polished or professional. The CoffeeScript site reports errors unintuitively yet visibly in the top-right corner. The TypeScript site requires that you scroll right to the error and then realize it's not just your browser complaining about a misspelling. But both are better than the Dart sandbox, which basically only says "error". None of them get page layout right. Dart and TypeScript have obvious input/output boxes, but both get demerits for their handling of overflow. Dart just grows the box which is acceptable, but TypeScript thinks their customized scroll bars are better than native. CoffeeScript handles overflow reasonably, but it's a big translucent overlay causing all sorts of moire on my screen. I suppose if you're on a Windows computer you might be tricked into thinking the TypeScript page looks reasonable, since it probably fits in. For me, though, I'm having a hell of a time figuring out what's a button and what's not.
- bilalhusain 13y agoI hope the respective developers are listening. It should be noted that most of these 'try X' editors are not marketed as a product, but I do agree that calling it 'professional' was mistake. The warts show up during heavy usage of a tool (the overflow example) and I was quick to reach conclusions based on the first impressions. But all the features like completion, line numbers, syntax highlighting do deserve respect (I couldn't find a better executed alternative!). Also, confirming that I am on a Windows computer :)
- brokenparser 13y agoThe language is nice, but the compiler uses its own lib.d.ts which has all sorts of definitions for browsers and even proprietary MSIE ones. This doesn't make any sense when using TypeScript in any other context (like Gjs, NodeJS, Rhino, Seed, etc.). TypeScript shouldn't assume a browser by default, or at least provide an option for compiling without lib.d.ts.
- wereHamster 13y ago$ tsc --nolib
- brokenparser 13y agoOoh, undocumented features! How nice, thanks =]
- dkarapetyan 13y agoAnders is a really good language designer. Everything this dude touches turns to gold. He was also behind C# and as far as enterprise languages go C# is a joy to work with. TypeScript is the same way. It's all really well thought out and instead of getting in the way the type system actually helps because you can leverage the dynamic aspects of JavaScript during the prototyping phase and then gradually add types as the design is fleshed out. Typed Racket I think is the other language that gives you similar capabilities but I haven't played enough with that one to have an opinion yet.
- oscargrouch 13y agoLinq (cough) Delphy (cough, cough)
- efdee 13y agoIs there anything wrong with LINQ that we are not aware of?
- Kutta 13y agoI guess it's not wrong, but not designed by Anders.
- hsitz 13y agoI assume you mean Delphi. Other than being now a little bit old school (not surprising for language with roots in Pascal), Delphi was and is an excellent language. Delphi was composed of a language (an ObjectPascal) along with the IDE, application framework, and Visual Component Library (VCL). These conceptual parts were all further developed in C#/Visual Studio, but they were already damn good in Delphi over 20 years ago, ahead of their time.
- radicalbyte 13y agoWe've been using TypeScript for 9 months now on a large project. It's fantastic. There's now way I'll go back to pure JavaScript again. The type system just catches so many defects, and they're of the kind that are hard and boring to find (typos). Plus IntelliSense integration (including jsdoc) is great. On the downside, our project takes some time to compile so we had to build a tool to do it incrementally. Plus it doesn't play well with one-class-per-file structures (but I expect that to be fixed).
- axefrog 13y agoAgreed, TypeScript is great, but the compiler is excruciatingly slow. I have to segment my app into multiple sub-build areas and only build a subset at a time, which is annoying because I frequently end up making small changes outside of that subset of code. My app is only around 25000 lines of code and a full compilation still takes around 50-60 seconds which, in a JavaScript workflow, is a lot of friction.
- camus2 13y agoAgreed, TypeScript is great, but the compiler is excruciatingly slow. This. at least the js one. Maybe VS is bundled with a Typescript compiler written in C# , i dont know,but clearly the javascript one is damn slow.
- dmck 13y agoVisual Studio uses the same compiler written in TypeScript/JavaScript. The Visual Studio integration is done in C# but only for interop with the Visual Studio APIs, there is only one version of the TypeScript compiler. I know when Palantir was developing Eclipse tools for TypeScript they posted to the Codeplex project regarding performance issues and the team from MS responded with suggestions about caching and only recompiling the minimal targets necessary.
- rplnt 13y agoI was expecting something in the order of minutes. Seeing as I work at a place where full build used to took about three hours on a server. I see how it's not ideal though.
- sytelus 13y agoHaving spent quite a bit of my dev life with typed languages and now coding a LOT in pure JavaScript, I'm actually not at all thrilled by TypeScript. Yes, pure JS is bit hard to maintain and it does occasionally pisses me off but at the same time it is liberating. Not having to constantly keep adding types all over, not having to constantly refactor things because I now accept object instead of an int etc is refreshing. And best of all, not having compile at all is fast and simple. I'm only using JS frameworks that doesn't force me do build before testing the page and retains purity of JavaScript (that means no simulations of traditional OOP). Yes, sometime I do make bad mistakes and spend some time chasing down bugs that would have been caught in typed languages. However overall I find cost of adding types all over and maintaining them over the evolution of code is actually higher. It would have been really great if they had produced cool algorithms that could have inferred types as much as possible and added it as static analysis tool instead of JS extension. Just because JS doesn't have type checking I'm now set in to mindset of doing quick tests of small changes, write more elaborate tests and so on. Even in moderately large project I think pure JavaScript is not only maintainable but also joy to work with compared to typed languages.
- pjmlp 13y ago> Even in moderately large project I think pure JavaScript is not only maintainable but also joy to work with compared to typed languages. You will see that joy quickly fade away in enterprise projects.
- anton-107 13y agoBut isn't it because in the enterprise projects JavaScript code is written by Java/C# developers who think they know JavaScript, while they really don't? I've seen multiple examples of "enterpisey" web apps, and there was no joy, just because developers didn't know how to build a good application with JavaScript and even more - they didn't care at all. With a "don't touch anything that works" mindset that lots of enterprise developers have - you write write-only JavaScript code and when it becomes too large - of course, there is no joy in touching this kind of codebase. Every enterprise project with a in-browser front-end needs a good front-end developer from the start to set up good code, good practices and good attitude to a front-end part of the code, and it will be fine: the joy won't fade away.
- skrebbel 13y agoMost significant announcement IMHO: > Today, we're announcing that we will begin taking pull requests for the TypeScript compiler and language service. A relatively-flagshippy MS project becomes truly open source. This is awesome!
- frik 13y agobtw. license: Apache License 2
- jeremiep 13y agoYou're required to sign a CLA before you can contribute and they only accept pull requests for bugs. Nothing prevents you from forking, but the main repository doesn't look 100% free.
- nimish 13y agoCLA's are good practice in general. It's always up to the maintainers whether they want feature requests. And as you pointed out, you can always fork.
- mauriziopd 13y agoHow does it stack with dart?
- jokoon 13y agoI thought it was a font. I was just opening MSVC expecting an update, looking in the font configuration menu and everything...
- benawabe896 13y agoI always get voted down for this, but I still feel that typescript is an answer to a question that nobody is asking. (I'm also very suspect of all of the positive comments. Is HN really this pro-MS for JavaScript?) In my company, we literally have a typescript counterpart team doing the same projects. Our code is cleaner, better architected, and our team is able to consistently produce 2 to 3 times more features. In my experience, the teams that choose typescript are usually windows devs that cannot wean themselves off of visual studio due to their dependence upon auto completion and IDE tools. I'm not hating, I just don't understand why any js dev would add code to their code.
- benawabe896 13y agoYep, voted down for no reason. I have actual real world experience with teams trying to use this technology. Is there an actual MS army trying to keep these threads pro MS?
- ternaryoperator 13y ago> In my experience, the teams that choose typescript are usually windows devs that cannot wean themselves off of visual studio due to their dependence upon auto completion and IDE tools. Well, since VS does auto-completion with JavaScript too, so maybe you're not understanding the whole situation. Some people like TypeScript for its ability to facilitate creation of large projects via addition types, classes, and namespaces, while retaining much of the basic JavaScript syntax.
- deleted 13y ago[deleted]