{"id":748,"date":"2013-02-27T14:43:27","date_gmt":"2013-02-27T19:43:27","guid":{"rendered":"http:\/\/alarmingdevelopment.org\/?p=748"},"modified":"2013-02-28T05:44:15","modified_gmt":"2013-02-28T10:44:15","slug":"state-of-the-dart","status":"publish","type":"post","link":"https:\/\/alarmingdevelopment.org\/?p=748","title":{"rendered":"State of the Dart"},"content":{"rendered":"<p>Coding again at last! In Dart. Herewith are my initial experiences with Dart.<br \/>\n<!--more--><\/p>\n<p>The reason I am using Dart is to run in the browser, which is the best platform for modern UI work. Being able to run on every device in the galaxy is a secondary benefit. What Dart offers over JavaScript is a serious language and a professional development environment. Everything I need is there, albeit still immature.<\/p>\n<p>I spent an hour or two reading the &#8220;Up and Running&#8221; guide and was able to start coding immediately. The major differences in Dart from vanilla OO ala Java are optional typing and constructors. Much has already been written about the optional typing but so far I haven&#8217;t found it to be a big deal compared to simple &#8220;var&#8221; type inference. It lets you get away with things like heterogeneous arguments and duck typing but so far I haven&#8217;t needed those features. Dart&#8217;s new approach to constructors aren&#8217;t discussed as much but are a big win for me.<\/p>\n<p>Dart makes object construction atomic and deterministic. Some common initialization idioms are outlawed &#8211; for example initializers can&#8217;t reference &#8216;this&#8217;. But it is so great not to have to deal with revealing partially constructed instances or non-deterministic class initialization order. A related feature is compile-time constant object instances with interning. There is also nice support for factory constructors. Dart&#8217;s creators are VM experts, and I think it shows in the way they have rationalized the insanity of laissez-faire construction.<\/p>\n<p>The Dart Editor is a slimmed-down Eclipse with all the essentials: type-driven completion, autofix suggestions, type and doc lookup, usage-definition traversal, and refactoring. Some of it is rudimentary, but I find there is enough to get real work done without cursing. I am a little worried that analysis time is already perceivable with less than a thousand lines of code. Update: there do seem to be scaling problems in the static analyzer, but I am told they are being actively worked on. I am hoping they can fix it before I write too much code, or else IntelliJ gets their plugin working.<\/p>\n<p>The libraries are the most immature, and feel a bit like an afterthought. There are excellent highly evolved class libraries to copy from, but it feels like they started from scratch. Or started from JavaScript, which is about the same thing. For example they just added Object.hashCode, and there still isn&#8217;t a Collection.equals method. But compared to JavaScript, the Dart libraries are already a giant win. I suppose they are prioritizing breadth over depth, which makes sense. So far no show-stoppers, but there is still an alarming amount of churn in the APIs.<\/p>\n<p>The one feature I wish Dart had was case classes as in Scala. These give you immutable value objects without the boilerplate hashcode and equals, and give you type-driven switch statements.<\/p>\n<p>Anybody else have experiences with Dart to share?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Coding again at last! In Dart. Herewith are my initial experiences with Dart.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-748","post","type-post","status-publish","format-standard","hentry","category-general"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pfEnU-c4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=748"}],"version-history":[{"count":13,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/748\/revisions"}],"predecessor-version":[{"id":758,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=\/wp\/v2\/posts\/748\/revisions\/758"}],"wp:attachment":[{"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alarmingdevelopment.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}