8 ms·
We are Switching to Dart
- tosh 14y agoBTW this is not an April fools joke :)
- MartinMond 14y agoI hope Google gets (even more) serious with Dart. Web App Development with JavaScript is a joke. Just remember the recent callbacks vs promise debate. It's like JS devs know nothing about software engineering.
- leeoniya 14y agodebate?
- MartinMond 14y agoI'm talking about https://news.ycombinator.com/item?id=5466872 https://news.ycombinator.com/item?id=5466872
- _jmar777 14y agoWhere to start, where to start...
- arkitaip 14y agoIt seems very risky to base your core business on a language that's only been around for two years. Sometimes web development seems to be more volatile than the fashion industry.
- lmm 14y agoWith the state of javascript at the moment you would certainly be using library code that's less than two years old to build core parts of your app. The line between language and library can get pretty blurry, particularly when we're talking about a language that compiles to JS.
- rictic 14y agoTo be fair, there's a difference between a library and a language here. Replacing or taking on the maintenance for a library is a much more feasible option for many than jumping to a new language or taking on the maintenance for an entire language (as it's not just the compiler, it's also custom tooling, debugging, plus Dart really needs its own libraries, etc.)
- at-fates-hands 14y agoI thought the same thing and wondered if they have a backup plan if/when Google suddenly decides to stop supporting it.
- pjmlp 14y agoQuite true. Every time I see such posts here, I think what is the business value of such changes.
- desireco42 14y agoThis sure sounds like April 1 joke, but, I get that developer(s) wanted something even more innovative then brunch and coffeescript. Like arkitaip said, it is a very risky move.
- michaelwww 14y agoRiskier than using the latest perpetual beta JavaScript library? I don't think so.
- desireco42 14y agoWhich one ?! JQuery? What are you angry about?
- michaelwww 14y agoI'm not angry, I just want something better. As Anders Hejlsberg said "you can write large programs in JavaScript. You just can't maintain them." http://lostechies.com/derickbailey/2012/06/04/anders-hejlsberg-is-right-you-cannot-maintain-large-programs-in-javascript/ http://lostechies.com/derickbailey/2012/06/04/anders-hejlsbe...
- peroo 14y agoWhy does so many startups feel the need to brag about the fact that they're switching to <hot new technology>? To me it just comes off as an attempt to convince themselves it's a great idea. How about coming back in a year and telling us how it turned out instead? Actual case-studies and analysis are interesting, fashion statements are not.
- dantheman 14y agoI think it does at least 3 things well: 1. It lets developers familiar/interested in the tech to know that you use it and that they should apply there. 2. You've done the work to research it and make the decision to switch - it doesn't hurt share that. Who knows someone may point out some flaws you didn't expect. 3. It increases the inertia of the technology. There are strong network effects in technology and if everyone sees that something is growing they'll make the jump too. One new library created per X developers is a big win and makes it better.
- tosh 14y agoThanks a lot for your comment. We'll definitely keep you posted on our journey with Dart. I don't have specific announcements yet but we're looking forward to share code examples and open source a few web components going forward. So far Dart really has been a pleasure to work with and we'll definitely blog more about it in the future and hopefully also go a bit more into detail. The main motivation behind this blog post came from people asking us about how it was to work with Dart and why we chose to adopt it. I can see how this might come across as a fashion statement but I just wanted to share my thoughts and have a url to point people to :)
- michaelwww 14y agoThe idea that this is fashion statement is laughable because Dart has been quite unfashionable until recently (like 2 weeks ago.)
- trimbo 14y agoAssuming this is not April 1 con'd. Dart is really cool. Awesome, in fact. I want this project to do well. But there's just no way I am going to base my business on it when not even Google uses it for their own stuff. It's just way too early.
- michaelwww 14y agoI don't know if Google does not use it for their own stuff and you don't supply references. That's not the same as saying Google will not use it for their own stuff. That would be quite surprising. In fact, I'm assuming they are developing it primarily as an internal tool, hence the disregard for a reasonable time line for shipment of 1.0
- munificent 14y ago> I'm assuming they are developing it primarily as an internal tool It's neither primarily internal nor external. My understanding is that the higher-ups feel Dart must succeed both inside and outside of Google to be successful. Which one must happen first is an open question, but I think the end goal is wide use both inside and outside the company.
- michaelwww 14y ago> end goal is wide use both inside and outside the company I agree fully. I would just add that, just in terms of salaries they've paid to Google employees working on Dart, they've spent millions, which they won't get back from by selling Dart. They probably have a compelling internal reason for doing this. They win if external developers adopt it because useful libraries will be written.
- munificent 14y ago> they've spent millions, which they won't get back from by selling Dart Yes, I think everyone understands today that languages don't directly generate revenue. > They probably have a compelling internal reason for doing this. Off the top of my head: * If it makes Googlers more productive writing apps in Dart, that directly saves Google money. We, obviously have some very large JavaScript applications (gmail, maps, docs...) and we spend a ton of engineering time on them. If we can make those engineers more productive, that's a huge savings. * If Dart succeeds externally, that's more third-party code that Google can then use for its own projects, so that directly saves us money. * If Dart makes other web developers more productive, that makes the web bigger. A bigger web means more people spending time on it and more people doing web searches, which ultimately goes right back to Google. Google is happy when the web gets bigger.
- MatthewPhillips 14y agoThe title is inaccurate, they weren't using JavaScript before, they were using CoffeeScript. Seems that the story is they are moving towards a more opinionated language/framework. That it is Dart isn't the story here; they don't even mention the Dart VM as a benefit for the switch. It just as easily could be ClojureScript, which provides all of the same benefits.
- michaelwww 14y agoCoffeeScript is JavaScript with syntactic sugar so the title is accurate.
- MatthewPhillips 14y agoBut the title makes it sound like they are changing languages when what the post is actually about is switching ecosystems.
- mraleph 14y ago[disclaimer: I work on Dart VM] Even though Dart VM is not a deployment target for the client side code right now it is still an integral part of the development experience. It runs all your code while you develop (no need to compile to JavaScript just edit&refresh) and backs things like dart2js, dwc, pub which are all written in Dart itself.
- MatthewPhillips 14y agoRight, but the author here doesn't mention the Dart VM as a reason for the switch; they are not switching to get better performance in Chrome. They are switching because they like the language/ecosystem better. Also, IANAL but I'm pretty sure you don't have to include a disclaimer to post on the internet. No one is going to rush out and buy Google stock based on your comments so there is no conflict of interest to what you wrote.
- mraleph 14y ago
- michaelwww 14y agoI think a few points are worth emphasizing. Dart produces JavaScript that is closer to being correct https://news.ycombinator.com/item?id=5424680 https://news.ycombinator.com/item?id=5424680 Dart can produce JavaScript that is faster http://news.dartlang.org/2013/03/why-dart2js-produces-faster-javascript.html http://news.dartlang.org/2013/03/why-dart2js-produces-faster... The JavaScript output of Dart2js works across all modern browsers (IE9 and above, among others.) No browser hacks required. Having said that, I wish they would stop working on advancing Dart and ship a 1.0 version. It's been 1.5 years since it was announced. Make the advancements in the 1.1 or 2.0 and give the tool developers a solid target to optimize for in 1.0. Let us not have to sell clients on a beta development system, even though that's what I'm doing and it's working, despite some panic when Dart developers break things with breaking changes (which is often.)
- trungonnews 14y agoIE9+. I hope people don't miss this keyword.
- michaelwww 14y agoThat satisfies all mobile development as far as I know. The loss is on Windows XP desktop for those stuck on IE8 and below. So far, I'm doing ok telling people to run Chrome or FireFox on XP as most of them are anyway.
- deleted 14y ago[deleted]
- tosh 14y agoTo give some perspective: we were lucky to have less than 2% of traffic coming from IE, most of those visits via IE9+. This made the decision to switch easy in terms for browser support in our case. YMMV of course but it definitely makes sense to look into your target audience. For some people Firefox 3 and IE6 might still be user bases that are worth supporting, we are glad to have a product for web and mobile developers :) I wouldn't be surprised if this decision also makes sense for a lot of other target audiences, especially when you consider that you are in it for the long term.
- apunic 14y agoI like your post since it's a refreshing take on today's language and framework decisions. Usually people go for Coffee, Node, Go, Clojure or ClojureScript nowadays (I mixed FE and BE tech deliberately). What I am interested in: Why did you go for Dart? What was the trigger? When I look at Google Trends Dart seems to have a very hard time compared to other current technologies regarding search popularity. And what's your backend based on? Could I go for Dart with Node?
- ahoge 14y agoYou could write the back-end in Dart, too. The Dart VM can do IO out-of-the-box. Just like the Node executable, it can be used to run command line scripts, web servers, or anything else you can think of. Anyhow, since the front-end only communicates with the back-end via standardized protocols (say, HTTP or WebSockets), it doesn't matter what's used on the server-side. These two parts are completely decoupled.
- vor_ 14y agoI would be too afraid to base a business on a language that's only two years old. It's not even a guarantee that the language will remain supported by Google in the long term, given their periodic house-cleaning.
- tjholowaychuk 14y agoWhy go through so much pain to avoid JavaScript, coffeescript now Dart? JavaScript is not the problem, it's how terrible our community is at sharing/creating modular things. Classes and shitty syntax wont help you there
- munificent 14y ago> JavaScript is not the problem, it's how terrible our community is at sharing/creating modular things. Classes and shitty syntax wont help you there How would you switch communities without switching languages? As far as I can tell, it's actually much easier to switch tech than it is to convince a million existing users to change their culture to something different.
- tjholowaychuk 14y agoNot really just stop using/promoting bad design like jQuery plugins, eventually people catch on.
- michaelwww 14y agoI'd like to know how they prevent plugins from colliding and polluting the $ namespace.
- tjholowaychuk 14y agoWe shouldn't use a $ namespace haha, that's a big part of the problem, which has nothing to do with JavaScript. jQuery was and always will be poor design. It's a great project and has obviously helped a lot of people but it makes no sense.
- michaelwww 14y agoI think you're wrong. JavaScript has a great community with tons of talent. JavaScript is the problem. You don't see nearly the same level of problems in the Python community for example.
- SeanDav 14y agoHow well does Dart work with node.js? Should I even consider Dart if using node.js?
- michaelwww 14y agoIt works transparently on the client to a node server of course. I haven't seen a lot of examples Dart interop with Node on the server. There are two choices, Use the Dart VM on the server and interop with Node through the js-interop lib, or use Dart2Js to convert Dart to JavaScript and operate with the node packages that way. There's still a lot of uncharted territory with Dart, which I think provides me with a lot of interest and opportunity.
- Daegalus 14y agoI think if you are using it in the server-side to just use the DartVM. its the direct analogy to Node.js. It runs server code and everything else. and I am not sure why you would even try to run it on Node.js except for some library that you really need. DartVM seems to outperform V8 anyway from the benchmarks on the Dart site.
- 33a 14y agoApril fools?
- tosh 14y agoIt's not, we're serious about Dart :)
- basch 14y agoWhy Dart over http://meteor.com/ http://meteor.com/ https://github.com/yahoo/mojito https://github.com/yahoo/mojito or http://derbyjs.com/ http://derbyjs.com/ ?
- eliben 14y agoThe answer is contained in your question, I think.
- mythz 14y agoExactly :) even more-so given the list is incomplete.
- basch 14y agothere are others? what other frameworks render the page server and client side? http://derbyjs.com/#why_not_use_rails_and_backbone http://derbyjs.com/#why_not_use_rails_and_backbone edit: ok I forgot http://www.socketstream.org/ http://www.socketstream.org/ but regardless, the realtime single page app sector really is dominated by those four products. everything else is already obsolete. http://derbyjs.com/#introduction_to_racer http://derbyjs.com/#introduction_to_racer
- michaelwww 14y agoMy April fools joke should have been that I've modified the CoffeeScript transpiler to emit Dart code - CoffeeDart!
- stephanos2k 14y agoInteresting post! I'm wondering: 1. How do you test your Dart code? 2. How do you integrate Dart with your existing Javascript? 3. Do you use Dart Web UI?
- sethladd 14y ago[disclaimer: I work on the Dart team] 1) We have unit tests and mocks built-in. Check out https://www.dartlang.org/articles/dart-unit-tests/ https://www.dartlang.org/articles/dart-unit-tests/ 2) We have JS-interop. Check out http://www.dartlang.org/articles/js-dart-interop/ http://www.dartlang.org/articles/js-dart-interop/ 3) We have tutorials for Web UI. Check out http://www.dartlang.org/docs/tutorials/ http://www.dartlang.org/docs/tutorials/ Hope that helps!
- tosh 14y agoGreat questions. Seth already hinted on some answers but I'll try to go more into detail. 1.) We have an acceptance test suite for the existing app (pre-Dart) using web driver and written in Python). This is currently quite useful since we can continue to use the same test suite when we've migrated a certain widget to Dart. Additionally to that we use the testing infrastructure that comes with dart: https://www.dartlang.org/articles/dart-unit-tests/ https://www.dartlang.org/articles/dart-unit-tests/ 2.) We use js interop http://www.dartlang.org/articles/js-dart-interop/ http://www.dartlang.org/articles/js-dart-interop/ to communicate between Dart and JavaScript. For the migration we are rewriting widget by widget (Backbone view by view). That's fairly straight forward since our existing Backbone.js codebase already was structured in a way where widgets are encapsulating behaviour, dom and style. 3.) Yes we do use Web UI. It's awesome. A bit like Angular.js but on top of a solid language foundation. We'll also look into open sourcing some of our web components going forward :)
- eliben 14y agoThis makes sense. Every time I side-peek at JS, I get terrified by the huge amount of libraries that one is supposed to be used to just get it running. It must be a liberating feeling to be able to just use one language with one standard library, for all your stuff. The "batteries included" philosophy worked well for Python.
- michaelwww 14y agoI wonder if we could go so far as to say Dart is to JavaScript what Python is to PHP? My whole reason for using Dart on a project was out of desperation because I was handed a JavaScript/PHP mess and I didn't want the nightmares to start again. I've been sleeping really well lately. Since Guido von Rossum did a stint at Google, all they need him to do is ask him to bless Dart and we're good, or find a suitable rock star replacement to promote "The Dart Way" ;-)
- xiaoma 14y agoMany libraries, including Underscore, default to the native browser methods when they're available. It's not really much of an issue deciding which map() to use.
- TeeWEE 14y agoWhile I think dart is a nice language, I do not think JavaScript is bad enough to justify switching to a completely different language. I worked on some big js projects, and together with a good module-system and jslint with strictmode on it works out all quite well. I think OOP is nice but you can do without much of it by focussing on composition instead of inheritance. http://en.wikipedia.org/wiki/Composition_over_inheritance http://en.wikipedia.org/wiki/Composition_over_inheritance Dart has a big focus on OOS and looks a lot like "JavaScript for Java Programmers". Which is not a bad thing.
- smrtinsert 14y ago5k large? 10k large? 500k large? the real test of a language is when it has all the millions of bug fixes built in over the years. At that point, do you feel comfortable refactoring/rearchitecting it to remove development inefficiencies? I argue that with Javascript there is no way you do once it grows beyond a small team size.