Live data from Hacker News

Dart Is Not the Language You Think It Is

programming.oreilly.com

71–80 of 143 posts

Re: Dart Is Not the Language You Think It Is

#71
post #59
post #14

Earlier quoted context omitted.

Walled garden?? It's the most open language I know, fully OSS'ed with an extended license to include any implicit patents (removing Patent FUD), developed out in the open and accepting 3rd party contributions and inviting feedback to influence language design. Lars Bak also mentioned at Google I/O that they're in the process of trying to get it standardized, not sure what's left to do to make it any more "open" and i…

How about putting it in the care of an independent foundation like the Python Software Foundation? Until Dart is wrested from corporate control Python will still be the more open language.

How would that make it better? Are software foundations some magical thing that makes all software that comes out of them better? Is this hatred toward large companies?

Direction coming from a company that has a goal for the language can be a good thing. Java was an amazing language for a number of years until Sun decided to let it languish.

Dart is under a very open license that anyone can take any part of the language and use it for their own. The website, spec, vm, analyzer, compiler, and editor are all under open and free licenses. If people get fed up with Google's handling of Dart, they can fork it.

Re: Dart Is Not the Language You Think It Is

#72
post #57
post #5

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

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-types/

Re: Dart Is Not the Language You Think It Is

#73

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…

IDE like Eclipse You don't need to write Dart in the Dart Editor if you don't want the IDE experience. I happily write Dart in Sublime, and Dart has command-line tools that I can use to validate the code that I write. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. If web developers are happy with the tools they have, then that's jus…

I asked the Dart team if they thought I should use Dart today. They recommended only using it on projects where I had the flexibility to wait a couple months for missing functionality to be written if it turns out my app needs something that isn't in the standard library yet.

There's definitely room for both polish and adoption.

Re: Dart Is Not the Language You Think It Is

#74
post #33

Dart is exactly the language that I think it is. It is too bad that it doesn't run on many browsers but that isn't going to change. What is the point of using Dart other than to join Google's garden of ugly walls?

Chrome has more market share than it did when Dart first was announced. That makes the decisions they make more influential.

If they can design a new language that's worth switching to and embed the VM in their browser, the other vendors will be more likely to implement it than when it was the little-browser-that-could. It's not a slam dunk (part of the reason Blink splintered off from WebKit was the pain of supporting two VMs), but the weather is changing quickly for Dart's chances to be a first-class language.

Re: Dart Is Not the Language You Think It Is

#75
post #24

Earlier quoted context omitted.

I think it's rather natural. Look at Haskell. Static typing with type inference was recently extended to allow "holes" in the type system. It lets you run broken programs, and let's be honest, my programs are broken (in some sense) most of the time. C++ lets you use the "auto" keyword in many places. Maybe the only thing strange here is that Dart has more of the "dynamic by default" mentality, but that's not strange…

Optionally specifying types which are otherwise inferred is not the same as optional typing . Haskell expressions always have a type. Often the compiler is smart enough to figure out what it is without you explicitly telling it, but it still has a type. Haskell typed holes still doesn't allow you to escape from the type system, it's more a way of saying "Here I am in the middle of an expression and I'm lost, could yo…

> Often the compiler is smart enough to figure out what it is without you explicitly telling it, but it still has a type.

I may be wrong, but I suspect you don't know how Haskell type inference works. (1) This is just semantics, but the compiler is not "smart" and does not "figure out" types. It uses a straightforward type unification algorithm (should feel natural to anyone who's programmed in Prolog) with a monomorphism restriction. (2) The type annotations you add may be different than the types that the compiler would deduce in their absence, and these annotations may in fact be necessary in order for the program to be correct.

Your question about Lisp has already been answered, but I will expand. The type checking can be done at runtime, at compile time, or at some combination of both—it is not always possible to deduce the type of function arguments at compile time in a language like Lisp. Obviously, (+ 1 "ABC") is an error, but not all situations are so obvious. The same is true in Python, Ruby, JavaScript, Objective C, Java, Haskell, and any other language which supports dynamic typing.

Yes, Haskell supports dynamic typing.

Re: Dart Is Not the Language You Think It Is

#76

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…

IDE like Eclipse You don't need to write Dart in the Dart Editor if you don't want the IDE experience. I happily write Dart in Sublime, and Dart has command-line tools that I can use to validate the code that I write. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. If web developers are happy with the tools they have, then that's jus…

>>You don't need to write Dart in the Dart Editor if you don't want the IDE experience. I happily write Dart in Sublime, and Dart has command-line tools that I can use to validate the code that I write.

This is the same line argument made with regards to Java too.

But the fact of the matter is, these language bring in so complexity with their whole ecosystem. Working without an IDE isn't even worth that torture.

Re: Dart Is Not the Language You Think It Is

#77
post #66

Earlier quoted context omitted.

Yes and no, An important caveat that Dart as JavaScript runs in it's own isolate and communicates with existing JavaScript libs through ports. This js-interop code is nearly 500k unminified. And you won't be able to minify all your JS (dartJs + other js) into one lib, because dart js doesn't play well with standard tools. One can certainly interop with js libs, but it's not pretty. Dart is not near 1.0 yet, so there…

Yeah - it would be nice if dart2js supported externs as in the closure compiler. I imagine that will happen at some stage.

Yes, I think so too. The question about the need for an isolate has been asked by a Google's own Dart evangelist, so it's on their minds at least. Notice there wasn't much of a response. It's not a hot issue, but I think it will be.

https://groups.google.com/a/dartlang.org/forum/#!topic/compi...

TypeScript is good that you can transition gradually. I've been using it for the past week and it almost feels like working with Dart with the advantage that's it's just JavaScript. TypeScript interfaces to hundreds of JavaScript libs and jQuery plugins have already been written.

I imagine I'll settle on Dart for some things and TypeScript for others and maybe eventually get them working together.

Re: Dart Is Not the Language You Think It Is

#78
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 ;-)

Re: Dart Is Not the Language You Think It Is

#79
post #76

Earlier quoted context omitted.

IDE like Eclipse You don't need to write Dart in the Dart Editor if you don't want the IDE experience. I happily write Dart in Sublime, and Dart has command-line tools that I can use to validate the code that I write. But web developers, who are the primary producers of JavaScript, will happily stick with Node.js, CoffeeScript, or plain JavaScript. If web developers are happy with the tools they have, then that's jus…

>>You don't need to write Dart in the Dart Editor if you don't want the IDE experience. I happily write Dart in Sublime, and Dart has command-line tools that I can use to validate the code that I write. This is the same line argument made with regards to Java too. But the fact of the matter is, these language bring in so complexity with their whole ecosystem. Working without an IDE isn't even worth that torture.

Dart imports are a bit less verbose as you do an entire library instead of a class like java does. As well, globally scoped functions let you code without all the OOP if you don't want it.

How do you use your JavaScript libraries today? Do you have evrything memorized?

Re: Dart Is Not the Language You Think It Is

#80
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…

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 obsolete compilers?) and its insistence that "++" is evil in both uses above is equally ridiculous.

I love static analysis, I like tools that automatically format source code (indent, go fmt, emacs), but JSLint is just annoying.

Post reply on HN