Hacker News new | past | comments | ask | show | jobs | submit login

Sorry man, accidental downvote. It was actually a +1.

I agree with you, the first impact with the language is terrible, the syntax is too reminiscent of Java. It seems that at Google Java is popular for web apps (GWT, Closure, ...). This must have had an influence.

I still fail to see what are the improvements over Javascript (while they managed to get the syntax worse). I guess a concurrency model, optional static typing, interfaces. Did I miss anything?




As I'm reading through the tutorial, it seems to me that it doesn't even have optional static typing. The tutorial claims:

> Types can help you write and maintain your code, but they don't change how Dart programs behave.

That, in my opinion, is not a type system, it's a documentation system. Writing

  String a = 1;
should crash the program/produce a runtime error in a language with (optional) static type system. In Dart, in only produces a compile time warning.


    void doSomething(String a) {
        // Do something 1
    }

    void doSomething(Integer a) {
        // Do something 2
    }

    doSomething("1");
    doSomething(1);
That's the sort of thing they mean by types don't change how programs behave. You can't easily change or remove the type system because it's tightly coupled with method resolution. If you have an optional type system, the evaluation semantics of the language cannot depend on the type system because you don't want the program to do something different if you are/are not using the type system.

The fact that type errors are only manifested as warnings is a (perhaps odd) design decision, but it doesn't stop them being type errors. They could just as easily made them errors, and String a = 1 would give a compile time error.

Hopefully they'll be a 'warnings as errors' flag for those of us more used to type errors being compile errors.


I like it. It still gives dynamic types like Javascript, but catches a huge class of errors immediately upon compilation. It's exactly what I wish Javascript had.


Yeah, those aren't types, they're merely annotations.


Have you seen ES.next? It's worse. I want to see T39 just start over and aim for the same elegant JS-style solutions that Dart has shown for things like class declarations and a separate int type. Instead they're adding things nobody gives a damn about, like debuilderstructors and shit.


> Have you seen ES.next? [...] I want to see [...] class declarations

Uh... like this? http://brendaneich.com/brendaneich_content/uploads/CapitolJS...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: