6 ms·
Ask HN: Why hasn't Dart become mainstream?
There was a lot of hype for Dart a couple of months/1 year ago and now it seems it faded away. What happened?
- proussea 12y agoI really hoped for something like python/ruby/coffeescript in the browser, and I got something that looks like Java. And yes, I admit it, I did stop to check Dart when i saw the curly braces. But others have probably better reasons ...
- hedwall 12y agoI remember RJS or what it was called, ruby compiled to javascript used in early Rails projects. Everyone I know that used it then have repented, it was apparently horrible..
- flowerpot 12y agoThere is also opal, which looks pretty promising. http://opalrb.org http://opalrb.org
- Alupis 12y ago> python/ruby ... in the browser not a good idea. any fullfledged programming language that can operate in the browser becomes a significant security risk. even with sand-boxing, if you can break out of the sandbox, then you have access to a full-fledged language with all of it's power. This is the reason Java has got a bad rap; it's due to the use of Applets in the browser from which people have repeatedly broken out of the sandboxing and then can execute arbitrary code on your system (without your knowledge). The only safe and secure way to have a language run in the browser, is if it just simply does not have the capabilities that could harm your system (ie. write directly to the disk, execute other local code, etc). If the language just can't do it, then there's no sandbox to break out of and due harm with. One of the (many) reasons Javascript has been successful. (I'm a Java developer)
- andreasvc 12y agoWhat are you talking about? Javascript is a full-fledged programming language. You can argue that certain languages are more or less difficult to sandbox, but then I'd be interested in knowing why this is. I think what actually happened is that they gave up on the idea of Java applets, and that led to it becoming a security hazard, not any fundamental property of the difficulty of sandboxing it.
- brazzy 12y agoYou think wrong. The inability to reliably restrict access to a rich API library full of dangerous stuff is a fundamental property of sandboxing as an in-language mechanism, or at least Java's sandboxing model. There's been a steady stream of critical security bugfixes for the Java browser plugin coming out of Oracle for years, and it's never been enough.
- andreasvc 12y agoI'm not convinced there is such an inability, or why Javascript would be particularly better. Simply don't offer the dangerous libraries as part of the runtime. It's the runtime which has to be secured, not the language.
- Alupis 12y agoI'm afraid it's not that simple. Vanilla javascript simply does not have the API's to make system calls. Java does, as does Python, etc. Removing from the runtime (like in a java browser plugin) is fine, until someone can break out of that sandbox and hook into the runtime installed on the system, or inject a runtime, etc. The thing that makes javascript a "safer" web language is it just simply cannot make system calls, period. This was by design, as javascript was intended for solely residing in the browser. All other languages have had "web" bolted-on after the fact, and all have failed to be secure in the same way Javascript has been. Node.js and derivatives have explicitly added this functionality, which is what we would then call a "general purpose programming language", aka. full-fledged language. There's no debate here. ECMA Script's designers were very public about their logic in the design process, and the reasons stated here are exactly why they made the choices they did.
- robbrit 12y agoI've had similar experiences, not just with myself but with a number of the other front-end developers I've worked with. I'd say the major problem is inertia: why switch when Javascript is working "well enough?" Dart does offer some degree of type safety, however it doesn't really have any killer features that make it a huge sell to the existing Javascript community. Contrast this with Coffeescript which provides a complete overhaul of Javascript's syntax to appeal to many web developers, especially those coming from a Python or Ruby background. It leaves the semantics the same with only a few syntactic sugars like classes and the fat arrow. To the fans of Coffeescript, both of these are the killer features that make them want to use it.
- jenscow 12y ago> make it a huge sell to the existing Javascript community Perhaps Dart isn't aimed at the Javascript community. They're happy with JS. It's more aimed at those who dislike JS, perhaps coming from traditional OO or static languages. Dart's killer features to me? - Tree shaking. You can add a large library, and dart2js will only spit out the code you actually use. - Classes, type safety, and generic lists.
- tosh 12y agoI also was hoping for syntax more similar to python (my background mainly is in python & ruby and I wrote my fair share of coffeescript). That said, in the day to day syntax (while important) is just a part of the equation. The main thing is that it does not get in your way (I struggled with JavaScript objects getting silently reduced to the first attribute in coffeescript because of syntax errors on my side). When evaluating a platform I look at syntax (the first thing you see) but then I try to look under the cover to see the whole. * What are the basic building blocks of the language * How is the standard lib * How is the 3rd party lib story (dependency mgmt, modularity, package mgmt, …) * How is tooling support * How is performance * How is working together with others * How is reading code I've written months ago * … In my book Dart looks pretty attractive once you take a closer look: https://www.dartlang.org/articles/idiomatic-dart/ https://www.dartlang.org/articles/idiomatic-dart/
- deleted 12y ago[deleted]
- adrianlmm 12y agoIMHO, Is not ready for main stream yet. 1.- There isn't native support in any browser, not even Chrome. 2.- Still has plenty of bugs. But there are cases where Dart is used, so, the reasons my vary.
- bussiere 12y agoFrom wikipedia : = A special version of Chromium (the open-source browser at the core of Google Chrome) comes with the Dart virtual machine, allowing it to run Dart programs.[19] As of May 2013, Microsoft Internet Explorer, Mozilla Firefox, Opera Software's Opera browser, and Apple Safari have no plan to embed a separate Dart VM.[citation needed] Dart source code can be compiled to JavaScript, allowing applications written in Dart to run in all modern web browsers. In the M1 version, released in October 2012, the generated JavaScript reached about 78% of the performance of hand-written JavaScript while native Dart code ran about 21% faster than similar code in V8.[6] = So for me : No browser except a special version of chromium, and slower than javascript whend compiled in it. So NO ... We have a lot of problem to have some standards on the web (css anyone ? ) , we fight with ie6, so taking such a non standard is nope.
- andreasvc 12y agoThat explains why it's not used in production. What I don't understand is why the idea of replacing Javascript with something better hasn't been embraced. Maybe Dart isn't actually better but I don't see anyone arguing that and that is the interesting substantial question.
- u124556 12y agoJavascript is being replaced by newer (hopefully better) Javascript. That's they only thing browser vendors can get in agreement. There's plenty of other javascript compilers for plenty of languages.
- freehunter 12y agoI really wish there way a way of coding for the web that didn't require [backend language] + [front end language] + Javascript (might be the same as previous two) + HTML + CSS. If I want to write a website in Python, I still need to know Javascript, HTML, and CSS, so why bother with Python?
- bad_user 12y ago
- outside1234 12y agoTypeScript and CoffeeScript are better in this space. Much more like JavaScript. TypeScript in particular, brings something like ES6 to today's browsers.
- jenscow 12y agoHow are TypeScript and CoffeeScript better? They are both languages that "compile" into Javascript, just like Dart is able to.
- LBarret 12y agoCurrently, it is not very compelling, it is well engineered but different enough to fuel enthusiasm. But if someone produces something interesting with it, all can change...as soon as tomorrow.
- christopherslee 12y agoMy developer experience with Dart was not a good one. The most succinct way that I read from other developer experiences on the internet was, "It's the worst parts of Java brought into Javascript". Not intended as a trolling statement, but like other folks have posted, it didn't strike me as having provided interesting value/productivity gain.
- lgunsch 12y agoI had the exact opposite experience. I was vastly more productive in Dart then in JavaScript. The code result was also more clear and understandable. I would say "readable", but often pretty looking code is as understandable as the Brain Fuck language.
- christopherslee 12y agoI'd be curious, have you tried coffeescript? I'm not a javascript fan by itself, but I do like coffeescript. I was probably making a comparison in my mind of coffeescript vs dart?
- bad_user 12y agoThe main problem with CoffeeScript is that you're still talking about the exactly same type system and mostly the same problems, minus some superficial fixes and plus some syntactic sugar. I prefer more heavy-weight approaches that use Javascript as a compilation target. Clojure and Scala can both compile to Javascript, but you're talking about different communities, libraries and tools, so very much like Dart, but focused on targeting just Javascript VMs.
- lgunsch 12y agoYes, I wrote coffeescript daily for a few months. It is also much more productive then JavaScript is, and I do enjoy it more then JavaScript, but I still find it lacking compared to Dart. Dart gives you the option of static typing. Static typing speeds up development because the compiler itself gives you a bunch of free debugging effort. I also find it much easier to manage includes and layout of the code. There is no need for tools like require.js, browserify, or bower.
- Igglyboo 12y agoThe only thing that even supports it is a special version of Chromium so why would anyone support it. If we could use it in mainline Chrome/Chromium then maybe it could start to take off but currently the install base is way smaller than even Chromes.
- tosh 12y agoDart runs in every modern browser (you can compile it to JavaScript). You can use it for real world projects. We use it in production at https://www.blossom.io https://www.blossom.io
- lmm 12y agoMozilla more or less killed it by saying they'd never support it.
- andreasvc 12y agoBut why did they say that?
- cwp 12y agoIt a threat to their control of the web. Javascript is currently the only real option for client-side software, and Mozilla owns Javascript. Why would they do anything to help Google take that away from them?
- zo1 12y agoI'm not quite understanding what you're saying. Care to elaborate a little more? Google already has a better JS implementation that Firefox,so how would less javascript usage be a good thing for Google?
- deleted 12y ago[deleted]
- bryanlarsen 12y agoAdding support for Dart would be a huge maintenance expense over the years, for a language that's basically a minor improvement over Javascript. If they're going to support a new language, how about something with widespread usage, such as Python? How about something that offers significantly different capabilities, such as R? How about something that supports a huge number of languages and/or significant speed improvements, such as the LLVM IR? If they're going to open such a huge can of worms, they're going to want to see substantial benefits rather than small incremental improvements. They obviously can't support everything, so to pick a language it has to be demonstrated that the language is a better choice than (pretty much) any other choice. Dart has not done that.
- 12y ago
- Mikeb85 12y agoI dunno, as far as a compile to JS, statically typed language I prefer Haxe. But JS is a great language - super flexible and powerful. How some people choose to use it is questionable at times, but there's no doubt that it's powerful.
- freehunter 12y agoI would love to learn Haxe, but anything I can find about it assumes you've been a professional Flash developer for 20 years or the example code doesn't compile (and the errors are quite cryptic to me). I need a Learn Haxe the Hard Way.
- Mikeb85 12y agoDunno, I never used flash but Haxe is pretty easy to follow. Try the newer OpenFL examples... It helps to learn using OpenFL since it sets up a project that compiles for you, then you can mess around with the syntax and language features. I also highly recommend using the 'Vaxe' VIM plugin with YouCompleteMe as well - it will recognize your OpenFL project, and give you context aware auto-complete, easy compilation of projects, etc..., making things much easier. While Haxe without any framework can be confusing at first, it's really not that bad...
- xyproto 12y agoWhich types of applications are Dart especially good at? I suspect there are currently always better alternatives.
- lgunsch 12y agoDart is good at large applications, like 50,000+ lines of code. After 50,000 lines of JavaScript, you really start to miss static typing and hate the type system that JavaScript uses.
- frowaway001 12y agoThis kind of ignores the second part of the comment: > I suspect there are currently always better alternatives. In my experience, this is true. There is no need for Dart, because there are languages which are better. So when people decide to replace JavaScript with something better, why would they choose "slightly better" over "significantly better"?
- jenscow 12y agoDart has the restriction of "must be compilable to Javascript". I guess the majority of existing mainstream languages have aspects that would make meeting this requirement difficult, without breaking the language. It's also about control. Once they implemented say, Python, there isn't then much room for improvement/change without it becoming a different language anyway.
- frowaway001 12y ago> I guess the majority of existing mainstream languages Given the wealth of languages out there, this still gives us a large amount of languages to pick from. > It's also about control. Once they implemented say, Python, there isn't then much room for improvement/change without it becoming a different language anyway. That's why they should have just standardized some IL format instead, and let real language designers target that IL.
- Derbasti 12y agoOr rather, why doesn't there seem to be much discussion about new native programming languages in the browser? JavaScript has many flaws, and there are plenty of languages available that have similar properties as JavaScript that do not exhibit these flaws.
- dandare 12y agoSimply because there is no incentive for some of the main players to make the browser significantly better. Actually the opposite is true - think of what has Microsoft and Apple to gain (or lose) if the browser becomes de facto replacement for native OS and their walled gardens? (in case of MS the wall is rather made of consumers inflexibility)
- marcosdumay 12y agoI'd say that Javascript is currently living a renaissanse, with people creating libraries that make it operate on completely different (and incompatible) paradigms. Untill we have one (or few) winning paradigm, there is no point in replacing Javascript. Whatever we create will become obsolet before it gets adopted.
- drabiega 12y agoI like Dart quite a bit. The tools are pretty nice and it has some good features. It's biggest problem from my perspective was the largely unfinished documentation. Many of the methods in the API reference list only signatures. I'd use it for some projects if they ever fix that.
- spankalee 12y agoMost of those methods are in dart:html where the library is generated from web IDL. We should be pulling in more documentation from MDN, so I'm not sure what's happening there.
- rogerbinns 12y agoI've been increasingly sceptical of things from Google, because of their track record. That includes the usual losing interest, as well as general people avoidance. Quite simply they are not a safe bet. That all said it takes time for things to become mainstream. See the Joel article: "Good Software Takes Ten Years" http://www.joelonsoftware.com/articles/fog0000000017.html http://www.joelonsoftware.com/articles/fog0000000017.html Go dates from 2007, and is currently 8 years old, and is heading into the mainstream. Dart is about 3 years old - it will take more time plus a non-typical Google track record to get there, if it ever does.
- saosebastiao 12y agoThe web doesn't need another language. It needs a sandboxable VM which has the DOM as a first class citizen. Dart didn't address that need...it merely provided another language and tried to strongarm its way into becoming a standard.
- lgunsch 12y agoDOM as a first class citizen is a non-feature. Dart didn't address that feature because they went out of their way to distance the language from the DOM, and instead provide a clean API on top of the DOM.
- andreasvc 12y agoWhat is the difference between having the DOM has a first class citizen and having a clean API on top of it?
- lgunsch 12y agoThe term "first class citizen" usually means there is a language syntax built-in for the feature that would be "first class." Dart has no such built-in syntax to deal with DOM elements. You have to use the API to manipulate the DOM. For example, the C language does not have OOP as a first class citizen. However, you can do OOP in C. GTK+ and GObject, for example, accomplish it.
- jenscow 12y ago> The web doesn't need another language Because choice is bad, right?
- saosebastiao 12y agoI'm not saying another language is bad, just that it is not a deficiency of the web. We already have hundreds of them...all of which are hacked onto a language that was never created with the intent of acting as a VM. A web-native VM would actually enable much better selection of programming languages than Javascript currently does. Dart is nothing more than a new soda selection in a broken vending machine. It hasn't gone anywhere because it isn't in any better of a position than the rest of the sodas in the vending machine.
- innguest 12y agoRemind me again why it's so hard to come up with a better alternative to the current HTML+CSS+JS mess? Is the only problem the fact that we need a language that can be easily sandboxed? Isn't Lua like that? Supposing we solve the sandboxing problem, what's the next problem? Offering a decent drawing API? Why not just offer an OpenGL viewport or something like SVG but with interactivity? I really need to be educated on what is the hard part about this (besides widespread adoption - so I guess I'm wondering what's the technical obstacle).
- andreasvc 12y agoMy impression is that it's mostly a matter of inertia. On the technical side I don't think any individual part is unsolved or even hard but technologies and their applications keep changing (e.g., mobile) so it's not possible to create one unified, elegant framework without it being obsolete immediately; the alternative is that we incrementally evolve the existing mess ... Furthermore, perhaps there's also an element of companies making their competitors' lives more difficult by not embracing standards introduced by others.
- aikah 12y ago> There was a lot of hype for Dart a couple of months/1 year ago and now it seems it faded away. What happened? I personnaly dont use Dart because IMHO there are better options right now for people who dont like writing raw javascript. Coffeescript gives the declarative style i want for quick dev. Typescript gives me the "type safety" that allows managing large codebases. Clojurescript for other stuff. The only reason I would use Dart is if Dart was part of the Android dev stack,or Chrome for the public. I see little reason to use Dart right now,though Dart has some very good libraries,for game development,angular dart ,etc ... So maybe in the future perhaps. I think Microsoft strategy (Typescript) is a better one.
- tosh 12y agoI might be a bit biased (we're happily using Dart in production at https://www.blossom.io https://www.blossom.io) but: I see more and more people I know who've been on the fence earlier to actually start to play around with Dart recently (last few weeks). Why? Improved Dart support for IDEs apart from the Eclipse based Dart Editor: * IntelliJ Webstorm/IDEA: https://www.dartlang.org/tools/webstorm/ & http://plugins.jetbrains.com/plugin/6351 * Sublime: https://github.com/dart-lang/dart-sublime-bundle * Chrome Dev Editor: https://github.com/dart-lang/chromedeveditor The platform itself is also maturing quickly. Some notable recent things from the top of my head: * Soon: Dart on App Engine: https://www.dartlang.org/cloud/ * Polymer.dart (replacement for Web UI, interop w/ Polymer.js) * Angular.dart (now 6 times faster! http://blog.angulardart.org/) * Dart became an official ECMA Standard (http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-408.pdf) * More and more incredible packages to use on pub http://pub.dartlang.org/packages?page=1 * Dart 1.6 soon to be released which supports installing pub packages globally (similar to npm) * People start to learn about functional reactive programming and Dart as great native support for its concepts: https://www.dartlang.org/docs/tutorials/streams/ Building and releasing non-trivial projects takes some time so there is always a bit of an incubation period re visibility of adoption and like I said from my own perception even though it is just a personal anecdote Dart is getting picked up. Shameless plug: I've also started a series of posts on why I fell in love with Dart. If you're interested to learn more check it out: https://medium.com/why-dart/why-i-fell-in-love-with-dart-1f89554a4171 https://medium.com/why-dart/why-i-fell-in-love-with-dart-1f8...
- mark_l_watson 12y agoLast year I was very enthusiastic about Dart, and before that Clojurescript. What put me off both languages was an experiment I did: I coded up the same non-trivial web app in Clojurescript and Meteor. I wrote the Meteor app in about half the time and it had more features. I didn't do the experiment with Dart, but I have written enough server and client experiments in Dart that I believe that Dart is not as agile as Meteor using plain JavaScript. That said, Dart is nice, and for some combined client/server projects it makes sense. I don't understand the complaints about it being a Google project though. I used GWT a while back on personal projects and for customer work, and Google did a good job of open sourcing it so betting a company on GWT seemed safe enough. I have the same opinion about Dart - it could have a life without Google support.
- Shish2k 12y agoI wasn't interested in the first place, because I don't want to replace JS with a different new browser-centric language; I want to replace it with an existing good general-purpose language that just happens to run in a browser.
- tosh 12y agoDart is an awesome general purpose language with great performance for the browser as well as stand-alone. You can use Dart to write server-side or command line applications: * Soon: Dart support for App Engine http://dartlang.org/cloud * Documentation: Dart command-line/server: https://www.dartlang.org/docs/serverguide.html
- EugeneOZ 12y agoBy the same reason why Rust hasn't became mainstream yet - just too young.
- dgregd 12y agoBecause it has too few good libraries and frameworks. For example I am waiting for a good Postgresql driver. The existing drivers have _async_ API.
- luci_pacurar 12y agoWhy do you consider async a drawback?
- antidaily 12y agoI, for one, welcome our new javascript-killing overlords.
- ReginaldBull 12y agoTo me Dart is really a great alternative to JS. The less I have to code in JS the better. Dart gives me the Java/c++ kind of language, has a lot of nice features out of the box, IntelliJ has a nice Dart-plugin - I can use strong typeded vars... Sure Dart has its kickups and it's traps but it i envolves and becomes more mature every day. What the Dart Team got wrong was that at first there target were all the JS-Devs out there. I think, a wrong decision. If you like JS, if you are used to the whole toolstack, you probably stay with JS. But if you like a statically typed, modern, language then Dart is a greate alternative.
- tosh 12y agoI also think that the Dart Team expected more uptake from JavaScript people (I also thought that) similar to how the Go people expected the most uptake from C/C++ people. Turns out that people who already are happy with an alternative solution are less likely to switch than people who are already unhappy with the alternative because they are not yet used to it/invested and judge it with fresh eyes (like people from other camps like Python, Ruby, Scala, C#, Haskell, Clojure, …). I personally find it sad that there is such an aggressive backlash against Dart from people who did not really take a close look at Dart or dislike Google for some reason (see Paul Graham's essay on how to disagree http://www.paulgraham.com/disagree.html http://www.paulgraham.com/disagree.html). If you look at decent JavaScript coders who are fluent with many programming languages they tend to see Dart in a different light, take it for what it is and judge it on its own merit. Maybe focusing on getting the JavaScript community excited was a bit too optimistic. I don't know, you gotta try right? That said, Dart seems to have an easier time with people who come from languages other than JavaScript or with people who only briefly learned JavaScript to do some stuff and wonder why they have to avoid 90% of the language and every library out there uses a slightly different not completely compatible set of conventions to emulate classes, promises, packages …
- Joof 12y agoThis may be naive, but why can't we just have an in-between compiled language (that isn't JS) that any language can compile to and compile back from?
- islon 12y agoFor me it doesn't have any interesting feature that would make me use it over Clojurescript. No macros, no functional focus, just the old Java way.
- pisabev 12y agoDart is alive and getting better with each release. I'm coding with Dart for 7 months now. I'm using it in production and don't want to look back. I'm not javascript hater, in fact i like javascript but Dart gives me much more - better app design, better performance, better productivity. The only downside is the libraries available (although growing constantly) - needs more time. We've ported relatively big javascript application (around 50k rows of code) and we're quite happy with the final result (hope never to write big javascript app again).
- rogerbinns 12y agoHow big was the code in javascript versus in dart? The smaller the latter number the more compelling dart becomes.
- pisabev 12y agoInitially the dart vs javascript code were almost 1:1(compiled ~ 2 : 1) at size We needed it to get it working first. But then we started to use some dart conventions and the code shrink. The compiled version is still bigger than compiled js though, but for me the real benefit here is the structure of the code - it is getting more and more manageble. The app is very close to ExtJS (custom windows like app)
- fmuaddib 12y agoI'm being using Dart for months now and I think people will soon realize that it deserves to be the next javascript. Here is what Dart really is: Node.js without the JavaScript baggage — I like Node.js because of the principles on which it was built: run things asynchronously whenever possible, use data streams whenever you can get away with it, and tie it all together with futures and callbacks. The problem with Node.js is that it’s JavaScript. There’s no distinction between types of numbers, working with arrays is always janky, NaN-infused wat moments abound, and so on. But Dart gives you everything that’s great about Node.js without the baggage of JavaScript clinging to the project like a nagging, alcoholic in-law. Dart has an incredibly robust stream API and top-notch futures support baked into the core dart:async library, plus a bunch of other stuff that you get for free, like WebSockets, SSL support, a decent math library (complete with ints, nums, and doubles out of the box), as well as the foundations for an Erlang-flavored actor system in the dart:isolate library. Basically, server-side Dart is trying to solve the same problems that Node.js was built to solve, i.e. problems around asynchronous, non-blocking I/O, but is doing so on a better VM and with a more robust and less flaky language. Another bit of good news is that Dart in practice is highly reminiscent of JavaScript, from the basic syntax to callback functions as first-class citizens, which means that the bridge from Node.js to Dart isn’t a terribly precarious one.
- jnowlan 12y agoAre there any plans for a coffeescript/python implementation of Dart? Could that be done as a preprocessor? As trivial as that sounds, that is part of what has hindered its adoption. I seem to remember reading about the Dart team learning that many early adopters were not c++/java people but Pythonista's. You'd think they would have adapted to that.
- airfoil 12y agoThere's kind of a Python-To-Dart translator: https://github.com/PythonJS/PythonJS https://github.com/PythonJS/PythonJS