Live data from Hacker News

Angular 2: Built on TypeScript

blogs.msdn.com

71–80 of 235 posts

Re: Angular 2: Built on TypeScript

#71

As if we didn't have enough reason to move on from Angular. Now you need to learn Typescript to contribute or grok the source files?

This is the main reason why I don't like using languages that transpile into JavaScript. I don't mind the languages themselves but transpiling into JavaScript now means you have to be effective in both languages instead of one to properly debug and you're also subjected to bugs that may or may not be known in the transpile itself. Everyone seems to hate on JavaScript but it's really not that bad to use.

I think the problem is that everyone freaked out with the angular 1.x to 2.0 changes. The angular team, not wanting to lose the 1.x momentum, decided to attempt to write a 1.x to 2.0 conversion tool. The major hurdle to doing this successfully is reliably interpreting javascript code such that it can be understand and converted by an automated programming. Now imagine if instead, all that code was written in typescript. Such a conversion tool would be arguably more simple.

It would seem that if you want angular to evolve in possibly non-backward-compatible ways, then conversion tools would be a requirement. And this is going to be a simpler task with a typed language.

Re: Angular 2: Built on TypeScript

#72

Are there any organized efforts to fork the 1.x branch to sustain existing applications?

Prob not from Google/Angular themselves. Maybe someone will be willing to maintain a 1.x branch for support $ ala what some people did for Rails 2.9.2+

Re: Angular 2: Built on TypeScript

#73

Earlier quoted context omitted.

This is the main reason why I don't like using languages that transpile into JavaScript. I don't mind the languages themselves but transpiling into JavaScript now means you have to be effective in both languages instead of one to properly debug and you're also subjected to bugs that may or may not be known in the transpile itself. Everyone seems to hate on JavaScript but it's really not that bad to use.

Transpiling may actually be the safest way to use JavaScript, especially given its rate of change. Take, for instance, a number of features trickling down the ECMA2015 pipe: modules, classes, "let", etc. Using these features without a transpiler, such as Babel, is simply not possible. A transpiler allows you to use these features now without any worry. Not all transpilers may be to your taste, but they have their pla…

> Transpiling may actually be the safest way to use JavaScript, especially given its rate of change. [..] A transpiler allows you to use these features now without any worry.

I disagree and my original statement applies as much to TypeScript as it does to an ECMAScript 6 transpiler. If you want to use the new features and you're transpiling now you need to have a good understanding of the differences between ECMAScript 5 and 6 and you open yourself up to possible bugs in the transpiler.

Instead you could just write ECMAScript 5 until 6 is more widely available. Sure no one likes to wait but it requires the least amount of expertise and lower chance of bugs from a 3rd party interfering with your application.

Re: Angular 2: Built on TypeScript

#74

Is javascript really so bad? Edit: Why did this question get down voted? It was an honest question...

Not unless you try to make it look like Java.

To be fair, JavaScript started out as a language that looks like Java.

"JavaScript was designed with Java's syntax and standard library in mind. In particular, all Java keywords were reserved in original JavaScript, JavaScript's standard library follows Java's naming conventions, and JavaScript's Math and Date objects are based on classes from Java 1.0" -- http://en.wikipedia.org/wiki/JavaScript#JavaScript_and_Java

Re: Angular 2: Built on TypeScript

#75
post #60
post #39

Earlier quoted context omitted.

Nope, 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.

I 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…

You 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.

Re: Angular 2: Built on TypeScript

#77

As if we didn't have enough reason to move on from Angular. Now you need to learn Typescript to contribute or grok the source files?

For some reason, I doubt that people here would be complaining about learning a language that resembles the next version of Javascript if it didn't come from Microsoft.

Probably, but that's a legitimate concern. Even with Microsoft's recent open source moves (which I think are pretty awesome), we've had a history of having Microsoft force languages and extensions down our throat in an attempt to usurp the open web and standards: ActiveX, VBScript in IE, .hta's, Silverlight, etc.

The counter to that is that TypeScript is Apache-licensed. However, you can't erase history by throwing up a Github repo.

Moreover, I'm hearing more people say they don't trust relying on a big corp for their client-framework. I think many don't disagree with that idea, but more or less trust Google, so they embrace Angular with prejudice. Anything with Microsoft's signature feels less open, and may push some past that tipping point.

Re: Angular 2: Built on TypeScript

#78
post #52

Earlier quoted context omitted.

> And the size of helloworld.dart.app.js is 102k No, it's not. dart2js --minify hello.dart -o hello.dart.js Results in a 5 KB JS file. This game is 35 KB (procedural graphics included): http://mbtic.com/games/fuzetsu

I imagine they've improved the runtime size since that stack overflow post was posted a few years ago. However I've never used dart and just tried it out using a basic html sample from the tutorial page and I see: 264 Mar 5 12:21 a.dart 237K Mar 5 12:21 a.js 101K Mar 5 12:22 a.min.js It was also slow to compile, 6 secs. Anything I'm missing? https://gist.github.com/ratbeard/70902d6347ad448de0a4

If you add gzip compression, it's still smaller than doing the same thing with jQuery. "dart:html" provides an idiomatic DOM API where all list-like things are actually Lists, events are streams, Futures instead of callbacks, and so forth. It's pretty nice to use, but it's also one of the bulkier libraries.

Also note that you could now add a thousand lines of code and the file size wouldn't increase much. You already paid that one-time cost.

You can further improve the size by using a better minifier on top of --minify.

Re: Angular 2: Built on TypeScript

#79
post #60
post #39

Earlier quoted context omitted.

Nope, 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.

I 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…

Completely agree 100%. Hopefully Typescript isn't merging any sort of runtime type checking.
Post reply on HN