r/programming • u/munificent • Oct 10 '11
Google releases Dart programming language
http://www.dartlang.org/8
u/scrogu Oct 10 '11
Looks like 1996 just threw up in my browser. Again.
I'll stick to CoffeeScript and the underlying flexibility and power of JavaScript.
-1
u/bonch Oct 10 '11
Look at all these Javascript fanboys posting their disapproval because their pet language isn't up to par.
9
u/dauphic Oct 10 '11
Why, exactly, does this language exist?
2
Oct 10 '11
JavaScript isn't suitable for the large browser-based applications that Google builds. But since the browser makers can't get off their collective ass to given us a common VM (e.g. CLR, JVM, or even P-Code) they are hacking together a language to use in the mean time.
3
u/azakai Oct 10 '11
JavaScript isn't suitable for the large browser-based applications that Google builds.
Well, that's what Google says, but is it true? What, for example, is wrong with building large browser apps with GWT? It seems to work very well in gmail etc.
But since the browser makers can't get off their collective ass to given us a common VM (e.g. CLR, JVM, or even P-Code)
All of those VMs have problems. Ignoring legal issues, which by themselves are enough to prevent any of those from being adopted, none of those VMs can run dynamic languages fast. The only fast dynamic language implementations live outside of static language VMs.
1
1
u/matthiasB Oct 11 '11
I have never really looked at so I don't know if it's suitable, but what about Parrot?
2
u/azakai Oct 11 '11
Last I heard Parrot is not production-ready or fully optimized.
If there are any Parrot devs here, I'd love to hear more info - it's a fascinating project.
1
Oct 11 '11
The CLR already has a lot of optimizations specifically for dynamic languages and is often faster than the native interperters.
I don't know about the performance of the JVM, but I do know it also runs a lot of dynamic languages and Oracle is committed to improving its support of them.
1
u/azakai Oct 11 '11
The CLR and JVM do have various optimizations for dynamic languages. But even so, they run them much slower than fully optimized native runtimes.
SpiderMonkey, V8, Nitro, LuaJIT, PyPy - all of those run much faster than any implementation of the same languages on the CLR or JVM. But you are right that some older and slower implementations of those languages - say, CPython - are slower than implementations on the CLR or JVM. But that isn't saying much.
1
Oct 11 '11
Wait, why are we talking about performance and dynamic languages. Having a decent VM means you get the performance of static typing if you need it.
1
5
4
-1
u/slurpme Oct 11 '11 edited Oct 11 '11
Every type in Dart is public unless its name starts with an underscore ("_").
Not good... not good at all...
Some really strange choices in syntax as well:
=> means "return"... bit weird <= would make more sense...
A setter can have a return type and a warning is thrown if it's not void...
Variables must be indicated by the keyword "var" but methods don't...
Interface factories sounds like something the Apache Foundation would dream up...
And apparently adding type information does NOT change behavior... Which doesn't make sense...
And who thought this:
By default, each Dart script tag’s main() is invoked on the DOMContentLoaded event. Ordering across script tags is not guaranteed.
is a good idea???
In fact they really need to get their act together with the documentation... At the moment it sucks, for example, you aren't supposed to have (but can, but what's the point since one script cannot access another) multiple script tags, you are supposed to "#import" other scripts but there is no indication of the syntax involved or when those scripts are loaded...
1
u/munificent Oct 12 '11
=> means "return"... bit weird <= would make more sense...
returnmeans "return" in Dart.=>is for declaring a single-expression lambda function. Like lambdas in other languages,=>functions in Dart implicitly return the result of their body.A setter can have a return type and a warning is thrown if it's not void...
Yeah, that part's a little strange. I usually just omit the return type.
Variables must be indicated by the keyword "var" but methods don't...
Variables must be explicitly declared using
var,final, or a type. Methods are also explicitly declared.Interface factories sounds like something the Apache Foundation would dream up...
"Factory" has bad connotations these days, but it's as good a word as any, and I think the semantics for the two things Dart uses the word for are pretty neat.
And apparently adding type information does NOT change behavior... Which doesn't make sense...
That's optional typing for you. It takes some getting used to.
they really need to get their act together with the documentation
Things are very very early right now. We wanted to get the language out so the public can get involved as soon as possible, so lots of stuff isn't there yet.
1
u/MatrixFrog Oct 11 '11
It's a work in progress. I much prefer they announce it with imperfect docs, rather than wait til it's done and can't be changed, then get feedback from the community.
14
u/sebzim4500 Oct 10 '11
Never been more disappointed.