Dart programming language design
johndcook.com
Dart programming language design
1–10 of 11 posts
Re: Dart programming language design
#2> We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t.
I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly in C++ talking about why C sucks.
Re: Dart programming language design
#3> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.]. > We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t. I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly i…
This has dynamic closure. Everything else has lexical closure.
Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function.
Variables must be declared with var, or they will still work but they will be scoped to the global environment.
Equality isn't transitive.
NaN is not NaN.
The way to convert a number to a string? Append a string.
aString + aNumber = aString
aString - aNumber = NaN
etc.
Re: Dart programming language design
#4> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.]. > We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t. I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly i…
How much Javascript have you written? This has dynamic closure. Everything else has lexical closure. Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function. Variables must be declared with var, or they will still work but they will be scoped to the global environment. Equality isn't transitive. NaN is not NaN. The way to convert a number to a string? Append a…
Re: Dart programming language design
#5Why bother with optional types (if you're enlightened enough to realise that you can just throw them away, since they're not needed for optimisation) when you could have richer compile-time contracts? Why bother with classes at all, when you could just have prototypal inheritance + interfaces?
I don't quite get what the goal is.
Re: Dart programming language design
#6> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.]. > We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t. I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly i…
How much Javascript have you written? This has dynamic closure. Everything else has lexical closure. Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function. Variables must be declared with var, or they will still work but they will be scoped to the global environment. Equality isn't transitive. NaN is not NaN. The way to convert a number to a string? Append a…
Re: Dart programming language design
#7Earlier quoted context omitted.
How much Javascript have you written? This has dynamic closure. Everything else has lexical closure. Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function. Variables must be declared with var, or they will still work but they will be scoped to the global environment. Equality isn't transitive. NaN is not NaN. The way to convert a number to a string? Append a…
There are probably as many if not more idiosyncrasies with any programming language.
Re: Dart programming language design
#8Of course, Java was designed in such a way and became widespread if not beloved. But then it too won what Bracha (in pooh-poohing Javascript's success) calls a "language lottery", meaning it benefitted from an accident of timing. Barring that happening for Dart, it seems unlikely that lots of smart programmers will get very excited about it.
One interesting point in Bracha's talk: he mentions the Dart VM more as a server-side platform - basically an alternative to Node.js - than as something they would ship to the client in Chrome. The client-side story, at least for now, is that Dart always compiles to JS. And he claims that they've already got compiled Dart to be about as fast as handwritten JS, which is surprising.
Re: Dart programming language design
#9This is a blasphemy towards static typing. Whenever the size of a software system stops being trivial, static typing is a must have to assume any kind of robustness. I cannot think of refactoring thousands of lines of code written in a dynamically typed language and sleep peacefully in the night. On the other hand, I can rely on the linker/compiler errors to, at the very least, flag any type misuse introduced due to my changes, in a statically typed one.
Re: Dart programming language design
#10> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.]. > We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t. I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly i…
How much Javascript have you written? This has dynamic closure. Everything else has lexical closure. Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function. Variables must be declared with var, or they will still work but they will be scoped to the global environment. Equality isn't transitive. NaN is not NaN. The way to convert a number to a string? Append a…
You can always call intVar.toString() if it pleases.