Live data from Hacker News

Dart Is Not the Language You Think It Is

programming.oreilly.com

91–100 of 143 posts

Re: Dart Is Not the Language You Think It Is

#91
post #60

Earlier quoted context omitted.

>Who is the audience for Dart? AS3, C#, Java, and JavaScript developers. That's why they went with C-like syntax. It's familiar to most people. >But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. I'm writing JavaScript for a few years now. I'm really tired of it. It scales very poorly and there is zero tooling. For example, JSLint is mo…

When I started seriously working with JavaScript, I decided to try to conform to community standards by using JSLint. I was shocked by how terrible JSLint was. It offered corrections for very straightforward constructs such as: var count = 0; for (var i = 0; i I have no idea why JSLint would tell me that I should move the definition of "i" to the top of the function (am I supposed to pretend I'm writing ANSI C for ob…

JSLint recommends declaring vars at the top of the function because vars have function-scope regardless of where they appear in the function ("variable hoisting").

Re: Dart Is Not the Language You Think It Is

#92
post #60

Who is the audience for Dart? Clearly it is first and foremost Google, whose programmers spend their days writing Java and C++ in an IDE like Eclipse. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. For that audience, they are given a language with optional static typing (most don't want it) and an Eclipse-based editor (most don't wa…

>Who is the audience for Dart? AS3, C#, Java, and JavaScript developers. That's why they went with C-like syntax. It's familiar to most people. >But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. I'm writing JavaScript for a few years now. I'm really tired of it. It scales very poorly and there is zero tooling. For example, JSLint is mo…

>Seen that "WAT" talk? None of that.

You realize Dart literally has broken generics? That the team thought covariant mutable collections was a good thing?

Re: Dart Is Not the Language You Think It Is

#93
post #72
post #57

Earlier quoted context omitted.

It's really not. It's the equivalent of adding "asserts" to your code.

No, in Dart it's not like that at all - almost the opposite. Type annotations have absolutely no effect at runtime. As the Dart documentation[1] says, "Adding types will not prevent your program from compiling and running—even if your annotations are incomplete or plain wrong. Your program will have exactly the same semantics no matter what type annotations you add." [1] http://www.dartlang.org/articles/optional-type…

Wait what? "Adding types will not prevent your program from compiling"

So even if you type-annotate everything, you will never get compile-type type errors? That makes the whole thing seem completely pointless.

Re: Dart Is Not the Language You Think It Is

#94

Who is the audience for Dart? Clearly it is first and foremost Google, whose programmers spend their days writing Java and C++ in an IDE like Eclipse. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. For that audience, they are given a language with optional static typing (most don't want it) and an Eclipse-based editor (most don't wa…

> For that audience, they are given a language with optional static typing (most don't want it) and an Eclipse-based editor (most don't want it).

There's also a plugin for Intellij IDEA[1], which is a great web (and other use) IDE.

[1] http://plugins.jetbrains.com/plugin/?id=6351

Re: Dart Is Not the Language You Think It Is

#95
post #23
post #5

Untyped languages are okay. Typed languages are also okay. Typed languages with inference are okay. Optionally typed is extremely strange.

> Untyped Assembly language is untyped. Dynamic typing is not the same thing.

If you accept the modern notion of types as proofs, dynamic languages are correctly described as untyped since they prove nothing about the code they run.

Unfortunately the term "type" is also used to refer to the tags dynamic languages put on data to prevent illegal operations. Confusion inevitably results.

Re: Dart Is Not the Language You Think It Is

#96
post #72

Earlier quoted context omitted.

No, in Dart it's not like that at all - almost the opposite. Type annotations have absolutely no effect at runtime. As the Dart documentation[1] says, "Adding types will not prevent your program from compiling and running—even if your annotations are incomplete or plain wrong. Your program will have exactly the same semantics no matter what type annotations you add." [1] http://www.dartlang.org/articles/optional-type…

Wait what? "Adding types will not prevent your program from compiling" So even if you type-annotate everything, you will never get compile-type type errors? That makes the whole thing seem completely pointless.

You get warnings. I guess the aim is to allow people to run their code no matter how broken it is, while still giving a way to detect some errors.

Seems pretty odd to me.

Re: Dart Is Not the Language You Think It Is

#97
post #5

Untyped languages are okay. Typed languages are also okay. Typed languages with inference are okay. Optionally typed is extremely strange.

Groovy has been using optional typing for years. Of course, to some folks, that might be proving your point ;-)

The optional typing in Groovy 1.x was really an instruction to the runtime, not compile-time type checking or compilation.

Groovy 2.x, with compile-time typing, only came out a year ago.

Re: Dart Is Not the Language You Think It Is

#98

Who is the audience for Dart? Clearly it is first and foremost Google, whose programmers spend their days writing Java and C++ in an IDE like Eclipse. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. For that audience, they are given a language with optional static typing (most don't want it) and an Eclipse-based editor (most don't wa…

For better or worse JavaScript is the lingua franca of the web, so if you want to go home early instead of tracking down compiler errors of the translation tool, the best way is just to use JavaScript.

Dart will never take off if the other vendors don't offer VM support on their browsers. Almost every language has JavaScript transpilers and as a Chrome only solution it won't work.

Re: Dart Is Not the Language You Think It Is

#99
post #42

Earlier quoted context omitted.

The JavaScript output runs on all of those browsers, but only Chrome (or actually the special "Dartium" version of Chrome) has a VM to run Dart code directly.

Why does that matter? Dart brings improvements to the language and tools that are worthwhile regardless of the VM being available in the user's client. dart2js is the primary method of deploying Dart code, and there's nothing bad about that.

It does not bring any advantage to the plethora of languages that already compile down to JavaScript.

Re: Dart Is Not the Language You Think It Is

#100
post #42

Earlier quoted context omitted.

The JavaScript output runs on all of those browsers, but only Chrome (or actually the special "Dartium" version of Chrome) has a VM to run Dart code directly.

Why does that matter? Dart brings improvements to the language and tools that are worthwhile regardless of the VM being available in the user's client. dart2js is the primary method of deploying Dart code, and there's nothing bad about that.

It does not bring any advantage to the plethora of languages that already compile down to JavaScript.
Post reply on HN