18 ms·
Announcing Dart 2 Stable and the Dart Web Platform
- beefsack 8y agoI wouldn't be interested in Dart at all if it wasn't for Flutter. I can't help but wonder if there will be Flutter bindings implemented for other languages sometime.
- alvivi 8y ago> will be Flutter bindings implemented for other languages sometime I hope so
- jdonaldson 8y agoAnybody looked at flutter for Haxe?
- parvenu74 8y agoWith Dart2 going through LLVM to make ARM binary code for iOS and Android (and Fuchsia), I imagine it would be trivial to emit WebAssembly as well. Writing Dart to make WebAssembly code is far more direct than writing C# and running MSIL on top of a micro .NET runtime (which is what the Blazor project is doing).
- mraleph 8y agoDart does not use LLVM anywhere in its toolchain.
- pjmlp 8y agoThat is the only way to keep Flutter relevant. Right now, in what concerns iOS and Android, Qt and Xamarin also compile to native, use mature languages (JS, C++, C#, VB.NET, F#), can also target desktop and have an endless list of libraries to choose from. Also Chrome team is quite interested in making PWAs succeed on mobile Web, and they have Microsoft on board with them, given how JavaScript has first class support on UWP.
- deleted 8y ago[deleted]
- skybrian 8y agoThis seems unlikely because most of the Flutter stack is implemented in Dart, except for the low-level graphics library. It would be more of a fork / rewrite.
- irq-1 8y ago> The Dart language, libraries, build system, and web development tools have changed. https://www.dartlang.org/dart-2 https://www.dartlang.org/dart-2 > ...announcing Dart 2, a reboot of the language to embrace our vision of Dart: as a language uniquely optimized for client-side development for web and mobile. https://medium.com/dartlang/announcing-dart-2-80ba01f43b6 https://medium.com/dartlang/announcing-dart-2-80ba01f43b6
- parvenu74 8y agoNow that Dart 2 is final, I'm guessing we're a couple weeks out from Flutter going 1.0 -- which will mean a ramping up of the Fuchsia rumors.
- jetti 8y ago> The other is an interesting quality-of-life change for Flutter developers, which allows creating an instance of a class without the “new” keyword. The goal of this change is to make Flutter code more readable, less clunky, and easier to type, but the principle applies to all Dart code. There have been plenty of other improvements happening under the hood, as can be seen in the official changelog. To me it seems kind of odd to design the language towards a framework. Then again, that framework is probably the only thing increasing the number of people using Dart so it does make sense to make using the framework as clean and easy as possible.
- kyrra 8y agoServer-side Dart is still there, but not getting a lot of support from Google, as it's not their primary focus. The renewed effort going into Dart because of flutter has also allowed AngularDart[0] to gain some of the benefits (better tooling and IDE integration). AngularDart 5 will actually be a huge quality-of-life improvement as they are killing the Dartium browser fork, and instead doing incremental-compiling to javascript with dartdevc. [0] https://webdev.dartlang.org/angular https://webdev.dartlang.org/angular
- jetti 8y agoRight, I know there are still other uses of the language but it seems like the language design is focused solely on Flutter experience rather than just overall language experience. I don't recall ever seeing such a design decision in any other languages and I just find it a bit odd.
- munificent 8y agoThere's always a certain amount of affinity between languages and frameworks. Few languages succeed with a compelling framework or "killer app", and few frameworks succeed without really taking full advantage of the language. In this case, we've been talking about removing "new" for ages, well before Flutter existed. It honestly never really made much sense in Dart. Flutter wanting it helped tip the scale and get consensus on the team, and now that we have it, it really does benefit all Dart code, even non-Flutter stuff.
- fullofsid 8y agoAnybody using only dart for their mobile apps, how has been your experience with it? Where does it triumph & fail over RN??
- deleted 8y ago[deleted]
- kasperpeulen 8y agoPros: * Flutter is faster. You really notice that for example the animations in flutter are much smoother than in RN * Flutter has really fast development cycle with hot reload (< 1s) * Writing UI only once for both iOS and Android * Better documentation * Better tooling support in editors (VSCode and Intellij) Cons: * The Flutter ecosystem is quite small, there are many lacking plugins * The Dart ecosystem is way smaller than JS * RN uses the native widgets, in Flutter they are mimicked and sometimes wrongly, for example the iOS datepicker
- devxpy 8y agoTo add to this - * Developing plugins (to use native code functionality) is fairly easy. I recently created a PDF viewer plugin for Android without any prior knowledge of java, in 2 days. * Dart has smaller ecosystem but dart is a real language with a batteries included std library. I don't think I need to state the superiority of dart as a language. * Flutter's non native components make it easier for you to customize them * Flutter doesn't have an obvious way to use native views in apps. You can launch native views but compositing native and flutter views is a bit weird right now. * The ease of use in the development cycle is phenomenal. Nothing like I've ever seen in UI dev.
- sbjs 8y agoSince there's so much competition in this area, hopefully this means Apple and Google will start to make this style of development a native part of their APIs and IDEs.
- beckler 8y agoMy only complaint so far is some things are not documented very well. I started leveraging the json_serializable lib and all my responses were returning null... it took me a few days of heavy debugging to figure out it was how I crafted my constructors and how the code generators worked with it.
- deforciant 8y agoI mostly spend my days writing Go (previously Python) and when I tried Dart I really liked it. Could basically start coding and be productive without even looking at language documentation (VSCode has a nice Dart plugin which tells you what to do and what not to do). In my case, I was trying out Dart because of a Flutter (probably majority of people are now looking at Dart because of Flutter) and I found it really fantastic. I love the tooling where you can just use their CLI to build/test the application without complex IDEs like XCode or Android Studio. If you want to try building a mobile app then definitely go for Flutter+Dart, even if you don't need to support both Android and iOS I think it's just much more easy to start with than alternatives (RN/Swift/Android Java).
- styfle 8y agoHow does your experience with Dart compare to TypeScript in VS Code? I haven’t tried Dart yet but my TS experience sounds similar to what you described.
- deforciant 8y agoI tried to like TypeScript a bit more than a year ago but couldn't, maybe I should give it another chance. I mostly do my frontend development in Vue.js so even though it supports TypeScript, I never found any need for it (I use typed Props to pass data between the components) as I try to make my UI as thin as possible, just fetching some data from the backend and displaying it. You can have a look at my project- https://webhookrelay.com https://webhookrelay.com (management UI is under my.webhookrelay.com), so far made it quite simple, material UI and only a little bit of JS. Obviously coming from Go to frontend I think I would benefit a lot from TypeScript.. Maybe one day :)
- solidr53 8y ago> If you want to try building a mobile app then definitely go for Flutter+Dart, even if you don't need to support both Android and iOS I think it's just much more easy to start with than alternatives (RN/Swift/Android Java). How is it easier? You can literally start your React Native development by opening up https://expo.io https://expo.io and scan a QR on your phone.
- jorblumesea 8y agoFlutter is going to make/break Dart. If flutter takes off, Dart is saved. Otherwise, looks bleak.
- pjmlp 8y agoThat is how I see it as well. Right now Android and ChromeOS teams aren't jumping of joy when questioned about Flutter and Fuchsia. So unless Google makes it a big deal to use Flutter, it will be just yet another interesting tech.
- mixmastamyk 8y agoWhen do you think flutter will support running on a stock Linux system?
- hencoappel 8y agoI believe people are working on making this work, also getting it to work in browsers.
- wstrange 8y agohttps://github.com/google/flutter-desktop-embedding https://github.com/google/flutter-desktop-embedding
- mixmastamyk 8y agoThanks, not officially supported.
- beckler 8y agoI am willing to bet flutter will be a pretty great success... have you used cordova/ionic/phonegap? (I can't personally speak for react native) There's a lot of ceremony in those tools, and debugging is clunky because you only debug from the browser, and you need a different browser depending on the phone type. There are a lot of gaps in every tool, and flutter isn't perfect, but the flutter team has been making some pretty awesome strides to making mobile development enjoyable for once.
- cookiecaper 8y agoThis is exciting. Dart is vastly underrated due to some bad press garnered around its announcement. I'm somewhat disappointed that they've reoriented to focus aggressively on front-end and dropped their custom runtime, but I understand this was mostly dictated by market realities. After they re-establish a foothold, I look forward to the return of a fully-fledged Dart environment and ecosystem.
- lubonay 8y agoI thought the Flutter SDK uses the Dart runtime to enable hot reload?
- mraleph 8y ago> dropped their custom runtime Dart VM is very much alive, nobody dropped it - it's used by Flutter to run Dart code, used by all Dart CLI tools (and Flutter CLI tools too) and on server side underneath pub.dartlang.org (and used on server by some other companies too).
- frollpin 8y agoCongratulations to the Dart team on that important milestone! Dart is already by far the most productive cross-platform web technology I've ever worked with, and it's getting even better with each new release. Absolutely love the language, tooling, and "batteries included" mindset. Everything "just works", and is solid, lightweight, and thought-out. Compared to many other languages/ecosystems I've worked with (not going to point fingers), Dart feels like an island of sanity and productivity.
- setheron 8y agoHow's dart as a server ?
- bovermyer 8y agoI believe that Google is now pushing Dart only for mobile development, and that the server-side Dart is dead on the vine. I could be wrong, but that's the impression I got.
- kasperpeulen 8y agoServer side is not dead, just dont expect them to make a Ruby on Rails kind of framework.
- munificent 8y agoIt's not dead, we (the Dart team) just haven't had the bandwidth to invest much in it for a while. It's still supported. Most of our own tools — compiler, analysis server, formatter, etc. — are all written in Dart, so we are heavily entrenched in Dart being a good tool for command-line applications. Being a good server-side language is a little different because then the ecosystem needs get much larger. You need things like database bindings, logging, etc. The current ecosystem for that on Dart isn't large but I hope we get there eventually.
- bovermyer 8y agoThis is great to hear!
- kasperpeulen 8y agoVery comparable with node.
- simplify 8y agoHow so?
- redsolver 8y ago
- AdmiralAsshat 8y agoI have no experience with Dart, other than having watched a livestream of Notch recreating Doom with Dart: https://www.youtube.com/watch?v=6p-Z6TXoN10 https://www.youtube.com/watch?v=6p-Z6TXoN10
- syspec 8y ago> The other is an interesting quality-of-life change for Flutter developers, which allows creating an instance of a class without the “new” keyword. The goal of this change is to make Flutter code more readable, less clunky, and easier to type Wait, not typing new accomplishes all those amazing things? Here i thought it was just three letters, which showed intent - hence easier to grok the surrounding code
- lasagnaphil 8y agoWhen you’re creating a big tree of component objects in pure code (without DSLs, macros, or something like JSX), omitting the new keyword is pretty nice.
- losvedir 8y agoYou'd be surprised. In Flutter you construct new objects _all the time_ and mostly inline (think React without JSX). The `new`'s really do get tedious when you're making a tree like: Container( child: Column( children: [ Text("One"), Text("Two"), Text("Three"), ] ) ) It's not major but I don't think your quote is overselling it either. It is a quality-of-life change that does those things.
- munificent 8y ago> which showed intent - hence easier to grok the surrounding code There was some concern that removing "new" would make it less obvious that an object was being constructed. In practice, though, it's been totally fine. The fact that the thing you're invoking is a class (and hence a capitalized name) seems to be sufficient signal that "you're making an object". Also, several other languages already work this way: Python, Scala, Kotlin, etc.
- myself248 8y agoThe Dart always was my favorite Dodge.
- wnsire 8y agoReading the few comments here is really interesting. Every-time there is a discussion about Dart , people talk about Flutter... they very rarely talk about Dart on the Server or on the Web... A while ago I considered using Dart to build a Web API. I was shocked by the non-existent ecosystem around this language. The Redis package has been un-maintained for almost three years now, and Angular Dart is always a few version behind the TypeScript version and doesn't support SSR. I was also very surprised that Google during dart conf never commented on using Dart on the server but instead always insisted on using it for their clients (Web and Mobile). I think I'm not lying by saying that a huge part of Google runs on JVM , Go or Python but definitely not on Dart VM. For me Dart is the language that developer needed , but never wanted to use. It failed miserably when it was introduced few years ago, since then JavaScript took off and has become almost a universal language. This is very frustrating seeing how much the language is efficient and well structured but it the same times doesn't mean much now seeing how mature JavaScript is becoming. For me Dart took long to become what is it now , and today the only thing that would make people using this language is really Flutter. Beside that , I'm afraid they are very little reason to use this language. [0]https://github.com/dartist/redis_client/tree/master https://github.com/dartist/redis_client/tree/master
- k__ 8y agoFlutter is probably the last attempt to get some Dart popularity. When Dart came out, Google build it to improve on JavaScript, by replacing it with a whole new language. Microsoft built TypeScript to integrate with JavaScript. I thought, "MS, right? Cobbling together some JS add-on, who will use that? Better get a whole now language that doesn't carry around that baggage from JS :D" I think Dart brought not enough new/better on the table, while having a worse JavaScript-interop than TypeScript. I mean it doesn't even have non-nullable types, which seems to be a standard feature in modern type-systems (Rust, Flow, TypeScript, Reason, etc.) My feeling is, some people will hype it a bit, because Flutter has a better architecture than alternatives like React-Native, but with projects like Fabric and Reason, nobody will care about it in a few years. But well, I also was wrong with my TypeScript prediction :D
- woolvalley 8y ago
- deleted 8y ago[deleted]
- EugeneOZ 8y agoI tried 1.x and I regret for wasted time. TypeScript is better for every niche Dart is trying to fill.
- munificent 8y agoI'm sorry Dart didn't work out for you, but I'm glad you found another language that's helping you. We're lucky to live in a time where there are lots of languages to choose from, each with its own strengths.
- timsneath 8y agoOfficial announcement here: https://medium.com/dartlang/dart-2-stable-and-the-dart-web-platform-3775d5f8eac7 https://medium.com/dartlang/dart-2-stable-and-the-dart-web-p...
- sctb 8y agoThanks, we've updated the link from https://www.dartlang.org/dart-2 https://www.dartlang.org/dart-2 and https://9to5google.com/2018/08/06/version-2-of-googles-dart-programming-language-is-now-available/ https://9to5google.com/2018/08/06/version-2-of-googles-dart-....
- iffycan 8y agoAs someone trying to make his first mobile app, I just ran through the Flutter getting started guide and it was a much better experience than getting a React-Native hello world going. Just a couple pros I see: * flutter doctor - what a helpful tool! * hot reload without losing state!? If Dart can use my existing TypeScript code, I'll definitely use it.
- skybrian 8y agoI don't believe it exists, but in theory someone could write a Flutter plugin to evaluate JavaScript on V8 (Android) or JavaScriptCore (iOS).
- jillesvangurp 8y agoThey should de-emphasize Dart and refocus Flutter development around Kotlin and make that a first class citizen and untangle flutter from Dart. Kotlin already is the language of choice for Android development has a very similar style to Dart (as in Dart provides few if any advantages that I'm aware off). Google already supports Kotlin in Android studio and adoption over the last few years has been enormous. Providing continuity for Android developers is hugely important. There's a Kotlin native compiler in the works that will support IOS, Android (native), servers, and WASM as outputs. This makes it a proper full stack language. Compiling to WASM to target frontend code is the sensible thing to do. As far as I can tell, Dart 2 compiles directly to javascript instead of using WASM. This does not make sense to me as a thing to push in 2018. Kotlin has one as well but they have shifted development towards their native compiler and supporting javascript vial wasm.
- rehemiau 8y agoWith Dart they can completely ditch the JVM and Oracle
- pjmlp 8y agoExcept that Google is actually part of the OpenJDK contributors. They only have themselves to blame for Android Java. If they actually bothered to buy Sun instead of hoping it would sink in silence, the situation would be quite different and most likely cheaper than what they already spent in lawyer wages and court expenses.
- geodel 8y ago> most likely cheaper than what they already spent in lawyer wages and court expenses. Not really. They would have spent max 100 million dollars in Oracle lawsuit. Still lot less than billions to buy Sun with its mostly non-profitable crap assets. Anyway I think Oracle seemed natural fit for Sun. The were already using in large number of their products and also selling licenses for turd technologies like J2EE app servers, portals, enterprise service buses and so on. Java EE was suppose to be big enterprise play and bring in lots of consulting revenue. It is only recently they finally called it a day and dumped EE assets in Eclipse backyard.
- kevingadd 8y agoDart's history of breaking on browser updates because of weird technical decisions really soured me on the idea of ever using it. It's apparently a really good language for native targets, but for the web... https://github.com/dart-lang/sdk/issues/13285 https://github.com/dart-lang/sdk/issues/13285 https://bugzilla.mozilla.org/show_bug.cgi?id=1027011 https://bugzilla.mozilla.org/show_bug.cgi?id=1027011 I can't really blame the language designers, but it's a good example of how if your goal is to cross-compile you have to be very careful about how your language is going to interact with the realities of the platforms it runs on. The idea of my deployed websites or apps breaking every couple browser releases really bums me out. (I've had to deal with it with other cross-compilers too.)
- dangjc 8y agoFlutter seems like the killer app that could revive Dart. In comparison: Javascript For mobile with React: no AOT compile. Relies on loading the entire JS VM which adds startup time and can require bundling a large library on Android. Cannot easily author customized components that render at native speeds. C# For mobile with Xamarin: No hot reload. Dart having its origin as a JS interpreted language had the foundations to be both dynamic and AOT. C# might not ever achieve this? Kotlin, Java, Swift, Objective C: Not cross platform. C++: Is cross platform. No hot reload. Very unfriendly to modern development and fast iteration. I don't actively work in mobile. I just like following developments in language technologies, so correct me if I'm wrong.
- pjmlp 8y agoHow have you not used Xamarin? Hot reload is supported, C# has a REPL nowadays and there are workbooks, Swift storyboard style. There are Java AOT compilers for iOS, at least three that I can remember of. C++ with Qt/QML is very productive for mobile development.
- dangjc 8y agore Xamarin: Only reloading your XAML or CSS is supported. With Dart, you can reload all your code, in the same way JS developers have had hot reload for ages now. I'm not sure if C# will be able to support this. This really leverages Dart's roots in being interpreted, not compiled. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/live-reload https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/... What changes does Live Reload redeploy? Live Reload only applies changes made to XAML or CSS. If you make changes to a C# file, a recompile will be required. Support for reloading C# is planned for a future release.
- pjmlp 8y agoYep, and as you quote "Support for reloading C# is planned for a future release." On the standard .NET Framework, edit-and-continue has been a thing during the last couple of years. I rather have the maturity of .NET eco-system, than the uncertainty of the young Dart one.
- moomin 8y agoIs it just me or do the first few paragraphs sound a bit desperate: “We’re relevant, really we are!” Don’t get me wrong, there’s plenty of languages that haven’t set the world alight that are nonetheless being used by a fair few people to do worthwhile things.
- leshow 8y agoI'm really not a fan of Dart's type system. It feels ancient to me. From what I can tell, there's no sum types, I don't see any way to bound generics based on interface/typeclasses/traits or some other equivalent concept on the docs, it has no non-nullable types. Am I wrong? Why would I want to use a type system that lacks expressiveness?
- munificent 8y ago> From what I can tell, there's no sum types Paraphrasing Qc Na: Subclasses are a poor man's sum type. Also, sum types are a poor man's subclasses. :) But, yes, some nicer notation for declaring a sealed family of types would be nice along the lines of case classes in Scala. It's something we've talked about a bunch but haven't had time to get to yet. > I don't see any way to bound generics based on interface/typeclasses/traits It uses the same syntax as Java: class Foo<T extends Bar> { T thing; method() { thing.methodOnBar(); } } > it has no non-nullable types. Not yet. :( I hope we can get to them.
- leshow 8y ago> Paraphrasing Qc Na: Subclasses are a poor man's sum type. Also, sum types are a poor man's subclasses. One of the great things about disjointed unions is (usually) exhaustiveness checking. Not to mention usually some form of pattern matching. Case classes would do the trick. It would be interesting to see those features in Dart, congrats on the release.
- qop 8y agoDart excommunicated server side dart. If I were someone who has already been let down once by that decision and is already frustrated by the extremely lackluster library story for server side dart, why should I use dart? Flutter is the only reason. I don't care about mobile. Hell, if they take android to flutter-only, it'll finally give me the fire to switch to iOS. I been meaning to anyways. I'm happy that Bracha got out of there. What a shame such a bright man's work has been so foully steeped in Google nonsense.
- hota_mazi 8y agoBetween Javascript and TypeScript on the front end and Kotlin on the back end, I don't see any area where Dart could ever grow to a meaningful mind share.
- e12e 8y ago"... the new keyword is now optional...". Why optional and not deprecated?
- munificent 8y agoDeprecating it is a breaking change and would make migrating code more difficult. It's like how semicolons are allowed but rarely used in Ruby, Go, etc. The style guide says to omit "new" [1], and our formatter can remove them for you [2], so the effect is that they are gone without the pain of a forced migration. [1]: https://www.dartlang.org/guides/language/effective-dart/usage#dont-use-new https://www.dartlang.org/guides/language/effective-dart/usag... [2]: https://github.com/dart-lang/dart_style https://github.com/dart-lang/dart_style
- c-smile 8y agoI have a feeling that Dart is just D (or at least they are comparable syntax and feature wise). So is the question: why Dart? Or is its goal to be a Java-on-Android killer? So always to have some [inspectable] bytecodes as a delivery media and JIT those on a device? But JavaVM is already there for that purpose so is that sacramental question again...
- jswizzy 8y agoFlutter is the groundbreaking thing about Dart. Other than that it's just Java 1.5 without the killer opensource ecosystem that makes Java relevant to this day. Rust, Swift, and Kotlin all blow Dart out of the water and are much better investments unless Google wants to make Dart the only language their new OS for some weird reason.
- dfischer 8y agoWho’s using Dart for Web (angular dart?). I’m interested in hearing pro’s / con’s especially if you have any experience with react as well. Thanks!
- bseidensticker 8y agoI work for Google on Search Ads 360 (formerly DoubleClick Search). All the frontend code I write uses Angular Dart and I love it. The best thing about it is the Intellij integration. I've never worked with an editor with semantic auto complete and jump to definition, so it's unbelievably awesome. Static analysis catches tons of errors, dev cycle is super short even for our giant codebase. I have some experience with React. My impression is that the React model is easier to understand and use at first, but may run into issues as the project grows. I have only ever worked on solo projects from scratch in React, and only ever on multiple 100k loc projects in Angular Dart.
- khkjb80 8y agoi would have totally jumped on the flutter bandwagon except i feel flutter missed a huge opportunity by not supporting web as a target. microsoft's react-native-xp seems like the right direction. i'd love to hae a combination of dart's sound typesystem + react-native-xp's api.
- Maultasche 8y agoI think that I would find Dart a lot more compelling if it emitted WebAssembly instead. There aren't a lot of languages that can compile to WebAssembly at the moment.
- mraleph 8y agoThat's because compiling non-C++/Rust-like language to WASM is unpleasant and associated with completely unneccessary overheads.
- andrepd 8y ago>we were able to ship a full-featured experience that is fully interactive in one second on modern devices and under five seconds on a modest mobile device on a slow 3G network Somehow, loading a text newsfeed in less than 5 seconds is an achievement in lightweightness. Sigh.
- dexterjs 8y agoSo we are going to ignore the slow 3g network aspect in the quote you are referring to then. Sigh.
- andrepd 8y agoThe very minimum admissible speed of 3G is 144kbps (barely faster than a 56k dialup, this is what we're talking about). The hn site should load in less than 3 seconds even on such an unrealistically slow network.
- gonyea 8y agoDart is really interesting. It's a cool programming language, managed by some incredibly smart people. It could have been what TypeScript is today, but failed dramatically due to a lack of pragmatism and an outright loathing for JavaScript. What soured me towards Dart is its continued history of ignoring community input. I remember when it was announced--the original "Hello World" transpiled to JS was around 70kb. 8-years later, and after all the user feedback (and shock in the original HN announcement), it's now around ~80kb. Why do this? Why continue to play so poorly with JavaScript? Dart2js is an indefensible Rube Goldberg machine that no human being can reasonably understand or debug.
- karmakaze 8y agoI'm very interested in Dart with Flutter being a better React-native. I have no interest in the browser, having already bet once in v1/we components. There are already great js frameworks. One thing that could win me over is if a sensible, composible layout hierarchy is used that always outputs the needed CSS.