Live data from Hacker News

Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

channel9.msdn.com

31–40 of 69 posts

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#31
post #24

Earlier quoted context omitted.

> I meant that dart is chrome-only in practice. I don't know of any other browser vendor that bundles the dart vm, including the few browsers based on chromium like rockmelt or 360. I didn't think even Chrome bundles Dart, yet, either; for native Dart (as opposed to compiled-to-JS Dart), Google distributes (both separately and with the Dart SDK) a special Chromium-based browser with the Dart VM integrated called "Dar…

Dart has special data types for the VM. They clearly want to target the VM for fast applications that aren't very usable compiled to JavaScript.

> Dart has special data types for the VM.

It has optional types, like many compiled-to-JS languages (as lack of declared types is one of the motivations for such languages.) I don't know what you mean by "special data types for the VM". Can you provide some examples?

> They clearly want to target the VM for fast applications that aren't very usable compiled to JavaScript.

Obviously, they think that the VM will provide some benefit over compiling to JS or they wouldn't make the effort of building the VM. But, unless you can give a reason to believe that they are crippling the performance of Dart-to-JS code to push the VM, I can't see why that would be a problem.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#32
post #22
post #16

To me this interview underlines the accomplishment of CoffeeScript. No committees. No marketing team. No developer evangelists. No PR team. No corporate interests. No budget. Just code.

Also nobody with the sense of history to design proper lexical scoping of variables.

This has been covered over, and over, and over again. CoffeeScript has some explicit goals with respect to the generated JavaScript output, and that includes not mucking with your identifiers. In order to implement correct lexical scoping, you'd need to rewrite identifiers to avoid shadowing and collision. CoffeeScript's design is a very reasonable trade off given the inadequacies of JavaScript.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#33

It's a pretty smart move that Microsoft did with TypeScript, making it a proper superset of JavaScript. Google seems to be stuck in the past, bringing out its own VM that is a complete non-starter, and making another class-based, Java-like language. I guess Google is going down the road that Microsoft did years ago with flinging feces on the wall and see what sticks. I have nothing against Dart. I played with it a ye…

Yesterday, I rewrote one of my JS modules into Dart, and it ended up being about 10 lines of code with only two modules imported. Then I compiled it to JS, and it was over 120k. I tried for about an hour to get that down to a reasonable size with Closure Compiler/Uglify, but the names were too wonky. I'm sure that, given enough time, they'll solve these problems, but as for right now... it isn't ready for primetime.…

You don't say if you used the 'dart2js --minify' setting, but Closure Compiler should do well. The --minify flag leaves alot more room for additional minification. You say you used two modules. The result really depends on the modules. For example, the Dart/JS interop module adds about 140K un-minified. Tree shaking is always on, so the 140K is after stripping unused code. I initially jumped into Dart because I was interested in doing packaged apps that run locally, so the size over the wire didn't concern me as much. I recently converted an ActionScript app to Dart and the post-minify Dart was around the same size as the compiled .swf file (for comparison, same functionality)

Seth Ladd has a couple of posts about Tree Shaking and Minification if you're interested http://blog.sethladd.com/2013/01/minification-is-not-enough-... http://blog.sethladd.com/2013/03/i-shrunk-my-dart-to-js-code...

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#34
post #22

Earlier quoted context omitted.

Also nobody with the sense of history to design proper lexical scoping of variables.

To achieve that CS would have had to put everything with a new variable inside a new function scope, having a major impact on performance and readability of the generated code.

Parenscript gets lexical scoping by renaming variables (but only where necessary). It works fine. The original variable name is used as a prefix, so the generated code remains readable.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#35
post #21

Haxe anyone ? full HTML5 api support , dead-code elimination, loads of libraries and frameworks , easy integration with third party libraries ,multi-target (C++,Flash,JS,...) and open source...

Haxe 3 is just around the corner, the RC is out right now. http://haxe.org/manual/haxe3/features

Not sure why it doesn't get more love here, it's awesome for developing complex js libraries, in addition to what you can do server side, and/or on a mobile platform.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#36
post #21

Haxe anyone ? full HTML5 api support , dead-code elimination, loads of libraries and frameworks , easy integration with third party libraries ,multi-target (C++,Flash,JS,...) and open source...

Stop trying to make Haxe happen, it's not going to happen.

I've been wondering whether I should start using this language for a project, and almost every time there's a good reason not too, but I'm still thinking one day there won't and i will. I'm curious to know what makes you think it will never happen, though.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#37

Earlier quoted context omitted.

Yesterday, I rewrote one of my JS modules into Dart, and it ended up being about 10 lines of code with only two modules imported. Then I compiled it to JS, and it was over 120k. I tried for about an hour to get that down to a reasonable size with Closure Compiler/Uglify, but the names were too wonky. I'm sure that, given enough time, they'll solve these problems, but as for right now... it isn't ready for primetime.…

You don't say if you used the 'dart2js --minify' setting, but Closure Compiler should do well. The --minify flag leaves alot more room for additional minification. You say you used two modules. The result really depends on the modules. For example, the Dart/JS interop module adds about 140K un-minified. Tree shaking is always on, so the 140K is after stripping unused code. I initially jumped into Dart because I was i…

> You don't say if you used the 'dart2js --minify' setting

I did. I'm no stranger to Closure Compiler, and even after fiddling around with ADVANCED_OPTIMIZATIONS for an hour, those ridiculous $variables persisted. What was even weirder was, just as a test, I imported a module I wasn't even using at all, and for some reason, Closure Compiler still refused to remove its code...

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#38
TypeScript is what Google Closure Compiler should have been; Closure’s static typing is similar but is much more tedious (you need to type 16 characters just to declare an int! https://developers.google.com/closure/compiler/docs/js-for-c...). I’m disappointed that nobody from Google Closure has stepped up to unify TypeScript and Closure’s syntax and to provide better tooling.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#39
post #36

Earlier quoted context omitted.

Stop trying to make Haxe happen, it's not going to happen.

I've been wondering whether I should start using this language for a project, and almost every time there's a good reason not too, but I'm still thinking one day there won't and i will. I'm curious to know what makes you think it will never happen, though.

It tries to be too many things to too many people, can't do a good enough job on any of it. Not really worth the investment.

Re: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

#40
post #21

Haxe anyone ? full HTML5 api support , dead-code elimination, loads of libraries and frameworks , easy integration with third party libraries ,multi-target (C++,Flash,JS,...) and open source...

It's unfortunate that Haxe doesn't get the recognition it deserves. The type system and other features blow anything comparable out of the water.

The language and compiler are solid, what it needs is better documentation, getting started guides, and tooling for things other than games with NME.

Post reply on HN