Hacker News new | past | comments | ask | show | jobs | submit login
Announcing Dart 2 Stable and the Dart Web Platform (medium.com/dartlang)
246 points by ScottWRobinson on Aug 7, 2018 | hide | past | favorite | 253 comments



Reading 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


I think what killed Dart is that they emphasized their plans to make Dart a first-class scripting language of Chrome, so that you could use <script type="text/dart"> instead of JavaScript. This had a lot of backlash from literally everyone, I think mostly because they were bit too hard by IE doing the exact same thing just a few years before. Only after a few years the Dart team changed courses and said "never mind about that VM-inside-Chrome thing, we're just going to compile to JS like everyone else" but it was too late and nobody cared about Dart anymore and all the excitement and enthusiasm was gone. I think people don't realize just how much excitement and enthusiasm from a potential community makes or breaks a project when it's first announced.


I'm on the Dart team and I agree with pretty much all of this.

Personal opinion time:

Lars and Kasper, the original leads and creators of the language came out very confidently with this mission to get Dart natively supported in the browser based on the assumption that the language was so good and the VM would be so fast that users would clamor it.

They had the best of intentions — they really did want to make a delightful, productive, fast language. They intended to move the entire web forward the same way V8 had when it first launched, and they believed deeply that Dart would enable that.

But I think they really underestimated how vastly different designing and marketing a language is from simply implementing an already-successful one.

It's not enough to just have a good product. The way you present it is often more important. And you don't even have the luxury of defining "good product" — you must be mercenary in letting your users' needs override your personal preferences. All of that was a real struggle for them.

For what it's worth, there's been a lot of staff changes over the years since Dart first launched. Lars and Kasper have left to try the startup thing again (which I think is a better fit for their skills and desires than evolving a big open source language). The team we have now, I believe, is much better aligned with what you're saying.

It sucks that we do have this baggage, but I hope we can improve our reputation over time. I'm hopeful we can — it took Java several tries before it found its footing.


I think a lot of what people found off-putting about Dart is that Google already recently came out with a new language that has become very successful. Announcing another one, which at first glance looks like yet another curly brace language not that far from Java, was a step too far for people to be interested.

Nowadays, the only thing driving Dart seems to be Flutter, which again is head-scratching. Like, "Flutter sounds interesting but in addition to learning Flutter I need to learn a brand new programming language for it that's really only used for Flutter?" People only have so much bandwidth for new things and there's already so much to constantly learn in our industry.


I could be wrong, but I don't believe the existence of Go was much of a problem. Go and Dart are very different languages aimed for very different use cases. If anything, I think Go helped us because we could point to it as a successful language that Google hasn't cancelled.

> not that far from Java

This is something that hurt us, I think. You can write Dart code that looks a lot like Java, and many of our early public examples did. To make matters worse, for no good reason, Dart 1.0 didn't do any type inference, so even though you could use "var" for local variables, doing so would give you a worse user experience.

But you don't have to write Java in Dart. You can write really elegant, clean code in Dart in a way that Java doesn't enable. You don't have to stuff everything inside classes. We've always had nice terse lambdas, higher-order functions, collection literals, etc.

Here's a random little program of mine:

    import 'package:hauberk/src/engine.dart';
    import 'package:hauberk/src/content.dart';

    main() {
      var content = createContent();
      var save = content.createHero("blah");

      while (true) {
        var watch = Stopwatch();
        watch.start();

        // Generate a dungeon at each level.
        var count = 0;
        for (var i = 1; i <= Option.maxDepth; i++) {
          var game = Game(content, save, 1);
          for (var _ in game.generate());

          // Read some bit of game data so the JIT doesn't optimize the whole
          // program away as dead code.
          if (game.hero.pos.x >= -1) count++;
        }

        watch.stop();
        print("Generated $count dungeons in ${watch.elapsedMilliseconds}ms");
      }
    }
It's not the most beautiful code in the world, but I do think it's a good bit simpler and cleaner than it would be in Java.


The thing is, this is almost identical to well written JavaScript. In fact you could do almost all of this in JS even before ES5. So the non-Java-like features you're using here were already present, which again suggests that Dart isn't really getting past the "Good Enough" problem.

It's also something you could do in Java, with the exception of having to wrap main with the obligatory EntryPoint class.

I think this just goes to show that good code can be written in almost any language (except Perl of course) because writing good code almost always just means writing obvious code, which necessitates avoiding cleverness and obscure features (literally all of Scala), twisting control flow (I'm looking at you State monads and call/cc), or adding too many indirections due to limitations of the language (Java).


> In fact you could do almost all of this in JS even before ES5.

Well you do get static type checking if you write it in Dart, but I see your point. :)


Why was "except Perl of course" needed here? Do you have any data to back up that you can not write well written code in Perl? Or are you just simply venting your prejudices?


> I could be wrong, but I don't believe the existence of Go was much of a problem.

It wasn't so much Go per se, but the fact that Google was pushing two new languages at the same time. It created the perception, for me at least, that Google was pushing out new languages to see which ones stuck and kill those that didn't. Google had/has the reputation for killing off projects that it lost interest in. And I wasn't willing to learn new a new language and its ecosystem only to be marooned there a few years later.

So, while I was definitely interested in alternatives to JS, there was no way I'd pick up on Dart.


Totally agree. Also, Go was refreshing. Intentionally limited, yes, but simple-yet-powerful. Then they show off Dart and it looked like yet another 90's-style curly-brace language, and I'm sure I'm not the only one who asked "why bother?".


That is nice. It's also almost indistuishable from Java 10. The string interpolation at the end is the last big syntactic nicety Java is missing - at least relative to this example.


Yes it is a little nicer than Java 11, but not so much to really make a difference, while throwing away all the Maven central goodies.

    import engine.*;
    import static content;

    import static java.lang.System.out;

    public class Demo {
        public void main(String args[]) {
            var content = createContent();
            var save = content.createHero("blah");

            while (true) {
                var start = System.currentTimeMillis();

                // Generate a dungeon at each level.
                var count = 0;
                for (var i = 1; i <= Option.MAX_DEPTH; i++) {
                    var game = new Game(content, save, 1);
                    for (var ignored : game.generate());

                    // Read some bit of game data so the JIT doesn't optimize the whole
                    // program away as dead code.
                    if (game.hero.pos.x >= -1) count++;
                }

                var stop = System.currentTimeMillis();
                var elapsedMilliseconds = start - stop;
                out.printf("Generated %d dungeons in %dms\n", count, elapsedMilliseconds);
            }
        }
    }


> I do think it's a good bit simpler and cleaner than it would be in Java.

Is it really? My Java is rusty, but now that Java has type inference it looks nearly exactly like what you'd type in Java (minus `public static void`, `new`, etc.)


Java 10 only has type inference for method-scoped vars.


Java 11 is around the corner and has improved upon it.


I removed everything that seems redundant. Less syntax means less to break, and less for new programmers (who are 10x the volume of existing programmers) to learn:

    import 'package:hauberk/src/engine.dart'
    import 'package:hauberk/src/content.dart'

    content = createContent()
    save = content.createHero("blah")

    while (true) 
    watch = Stopwatch()
    watch.start()

    # Generate a dungeon at each level.
    count = 0
    for (i = 1; i <= Option.maxDepth; i++) 
        game = Game(content, save, 1)
        for (_ in game.generate())

            # Read some bit of game data so the JIT doesn't optimize the whole program away as dead code.
            if (game.hero.pos.x >= -1) count++      

    watch.stop()
    print("Generated $count dungeons in ${watch.elapsedMilliseconds}ms")


how are the semicolons in a for loop redundant? Without them it's extremely difficult to parse what's going on.


Typo when removing the others. Thanks for the spot. Maybe a forEach or map might be more appropriate for all those future programmers anyway though.


While you're there, you may as well indent everything after the "while(true)"


Oops, I killed that during one of the edits.


Separating variable declaration and reassignment at a glance makes code more clear. Indenting loop bodys makes code more clear, and the curly braces won't suddenly break. Keeping lines short makes it nicer to work with in various editor setups.


> Separating variable declaration and reassignment at a glance makes code more clear.

Hrm, maybe. Python does well not using them - if you reassign something, it's being reassigned. Maybe, since declaration is more common, make declaration the default and reassignment explicit?

> Indenting loop bodys makes code more clear

Glad you agree.

> curly braces won't suddenly break

They do all the time, everytime indentation (how people read coe) gets out of sync with braces. Hence avoiding redundancy.

> Keeping lines short makes it nicer to work with in various editor setups.

Displaying code to match the screen is the editors job. Sometimes your screen is 30 characters, sometimes it's a lot more.


It's a shame, I was a HUGE dart for backend proponent. I made libraries and even middleware for API servers and such. I was constantly fighting to get ANY focus on the backend standard libs. In the end, I had to give up and stopped fighting. I still maintain my uuid, base32, and otp libraries, just upgraded them for 2.0, but Its a shame because Dart could have so easily competed with Node.js and it was a major replacement for it for me.


A language by itself is almost never useful, every language needs a killer app, a concrete tangible thing that that language can do better 100x better than any alternative. Like how Ruby had Rails or JS had browsers or Python has ML. That’s not to say you can’t do other things with these, just that their competitor is good enough and has momentum and mind share. It sounds like Dart now has Flutter and I think that’s going to be a huge deal moving forward.


> A language by itself is almost never useful, every language needs a killer app,

I don't understand why this myth is still around.

C++ never had a killer app to start its momentum.

Neither did Javascript. Nor Java really (or maybe applets, back in the days?).

Languages can succeed on technical merits alone if they come out at the right time and fix real problems that programmers experience on current mainstream languages.


I think you need at least one of three things to get a new language off the ground:

1. Extreme compatibility with the current entrenched language so you can incrementally migrate. C++ from C. CoffeeScript and TypeScript from JavaScript. Kotlin from Java.

2. A killer app (well, framework). Rails for Ruby. WinForms for C#. Applets and J2EE for Java (later Android).

3. A new platform where you must use the language to target it. C for UNIX. Objective-C for iOS. JavaScript for the browser.

There are a few exceptions here and there, but the above are the typical well-trod paths to success for a language.


I listed two clear counter examples to claim #2, C++ and Javascript. I'm even tempted to put C in that list, because C was already popular before Linux.

What was Python's killer app?

What is Rust's killer app?

Go's?

Kotlin's?

Java is a counter example to your claim #3 since it not only does it run on all OS'es but you can also develop it on all OS'es.


"at least one of three"


> What was Python's killer app?

Not a killer app, but the fact you have so many ML frameworks

> What is Rust's killer app?

That's clearly Servo.

> Go?

It was docker which really made Go take off, it was their first big platform.

> Kotlin's?

Android compatibility, before that it was a niche language not being picked up much.


Python already won before ML was a thing.


In his early days, Python did not need anything, it was simply nicer to use than the other languages. Nowadays ML is a big plus.


It was called Zope.


Killer app is the wrong phrase. Rather every new language needs a competitive upside over existing languages to be successful. At which point your proposed questions have easy answers.


C++ and Javascript are definitely not counter examples as I commented.


Outside of the HN bubble python is the only one of those that got off the ground so far.


> C++ never had a killer app to start its momentum.

C++ was immediately adopted by all major C compiler vendors as it came from AT&T as well.

Microsoft C/C++ 7.0 for MS-DOS was the very last one to adopt C++ on the toolchain.

It was the lingua franca of all major desktop OS GUI frameworks, leaving C just for their lower layers, MS-DOS (Turbo Vision), OS/2 (C/Set++), Windows (OWL, VCL, MFC), Mac OS (PowerPlant, MacApp), BeOS, Symbian.

If you were doing plain C GUI programming you were doing it wrong.

> Neither did Javascript.

JavaScript owns the browser, there is hardly any other alternative regarding "browser systems programming".

> or Java really (or maybe applets, back in the days?).

Java's portability was a gift compared with C compilers still in the middle of migrating from K&R C to ANSI C, C++ compilers which were silos with their GUI frameworks and a standard still a couple of years away to be fully defined.


These days it's mostly about apps, because apps are the main thing that facilitate the transfer of $$$. In the 80s and 90s, enterprises were full of $$$ and needed fast and safe languages for writing all their software. C++ came out to solve this need, and Java came out saying it could do it better. Today enterprises are moving many of their internal tools to the web. Enterprises don't need apps per se, but they do need the tech needed to build internal apps and apps to bridge between them and their partners. Consumers are using desktops less, and mobile or web more. Apps are basically the current de facto software "product". But a lot more goes into making apps today than 30 years ago. An example is how most apps need ML for spam protection and recommendation algorithms, or they are instantly going to be considered outdated and behind the times.


>In the 80s and 90s, enterprises were full of $$$

More than today?


I haven't had my caffeine yet today cut me some slack :)


Golang and Rust also didn't have any killer app.


Rust definitely has Firefox


Just thought I'd remind you that there are currently 0 Rust jobs on Indeed.co.uk by title for the whole of the UK. The HN bubble is not how the world at large operates.



Firefox is not the kind of app to drive adoption of the language (like Rails or Python scientific libs etc). It's just an app, people using it could not care less what it's written in.


Go has Docker


Yes, but it didn't have anything before it, and yet it gained adoption like crazy.


Go has a bit of a niche, and Rust is trying real hard, but they aren't Javascript or Java, or C#, or Python, or Rails, or PHP, or C++, or Objective-C or... Out in the wider world, they are very much playing catchup, and have a very far way to go.


Javascript had the web. And, Java had the JVM. A killer 'app' is not necessarily singular & discrete.


Off topic but... are there any plans to adapt Flutter for desktop apps?


I'm the lead dev on just such a project: https://feather-apps.com/


Looks great!

I beat the Reversi app on first try. I'm guessing it's not very strong. :)


Thanks :)

Haha yes I weakened the AI somewhat compared to the original version created by RedBrogdon. It's not fun to be constantly thrashed by an opponent who takes 0.2 seconds per move! Despite my changes I still lose about 3 out of every 4 games :(


There is an unofficial implementation for it.

https://github.com/google/flutter-desktop-embedding


I agree. In addition because Dart shared some superficial similarities with Java, some people just assumed it's Java and criticized the language for it. For example Dart variable declaration is of the form "String a" vs "var s:string" - the former syntax looks like Java so Dart must be Java. It certainly felt like people were willing to 'pile-on' criticism because they felt that JS ecosystem was threatened.

The language itself is very well designed and pleasurable to write code in.


I think your points about Dart being treated unfairly are legit. OTOH, Google certainly invited criticism - early Google efforts on the web were VERY "let's make JavaScript into Java", and as the JS community matured this attitude was viewed with less and less favor. I think it's notable that the community that DID end up having strong influence in the JS world (Node & npm) had much more of a Ruby background than Java.

None of which invalidates Dart, but I know I was less than excited when Dart was announced as it seemed more Browser Wars crap rather than an improvement. Nowadays I'm more inclined to hold Google's history of not supporting products consistently (or at all, in most cases) against Dart than anything about the language specifically,


>early Google efforts on the web were VERY "let's make JavaScript into Java"

That was never the case. Ever. Google was the first company to really take JavaScript seriously and launched the client-side JavaScript revolution with Maps and Gmail.

This criticism was leveled at Dart because as I argued, when Dart was launched some people (purposely) found certain parts of the syntax superficially resembled Java. It was also a time when front-end web devs haven't rediscovered the benefits of compile-time type checking (there was a time, believe it or not, when static typing was disparaged by frontend web-devs)

The irony is that Dart is a better language than JavaScript and the world would have benefitted had Dart become a browser standard (though Apple, Microsoft and Mozilla were never going to just accept a language designed by Google - so that was a pipe dream).


> Google was the first company to really take JavaScript seriously and launched the client-side JavaScript revolution with Maps and Gmail.

True! Google Maps was a revolutionary use of AJAX. However, that is totally orthogonal to if JS was being written like JS, or like something else.

> This criticism was leveled at Dart because as I argued

Except I wasn't leveling that criticism at Dart. I'm talking about Google efforts in general at the time. You can see it in GWT, you can see it in the first generally accepted JS styleguide (done by Google), and you can REALLY see it in the articles and efforts of Google at the time where person after person laboriously tried to make JS _behave_ like Java (so we're not talking syntax). The late 90s and early aughts were a battle between those that wanted to recreate Classical OOP in JS and those that wanted JS to be what it has ended up being.

I don't even KNOW Dart to criticize it about anything, but I knew what I was seeing from Google at the time and why I wasn't swayed that they were creating something that would be accepted by the community and other browser makers.

> (there was a time, believe it or not, when static typing was disparaged by frontend web-devs)

...and it continues to this day in many corners - the issue (generally) isn't static typing but instead the cost/benefit involved - are enough runtime errors prevented to cover the cost of me informing a type system. There's a reason JS has spread so far - the time cost of static languages is just as real as the runtime risks of dynamic, and pretending that this equation should always favor proven correctness just results in more work being done in the dynamic camps.


> There's a reason JS has spread so far

The large number of people who had to know it because of its status as the only reliably-available cross-browser web client language, and the focus engines got because of its web client role, mostly.


>I'm talking about Google efforts in general at the time.

Ok, but just to be clear, at no point did Google actually try to replace JavaScript with Java.

>You can see it in GWT

Oh come on. GWT was transpilation tool with a built-in component framework. It solved a real problem for specific use-cases and was primarily adopted by enterprise developers. It was never a replacement for JavaScript.

>and you can REALLY see it in the articles and efforts of Google at the time where person after person laboriously tried to make JS _behave_ like Java

Can you provide an example of this? I have no idea what you're referring to.

>The late 90s and early aughts were a battle between those that wanted to recreate Classical OOP in JS and those that wanted JS to be what it has ended up being.

And Google was a non-factor in the development of the web technologies and standards in the late 90s and early 00s (Chrome wasn't released until 2008. Ajaxy Gmail was released in 2004). Also, nobody gave a crap about JavaScript in the 90s and early 00s (Crockford's JS:The Good Parts wasn't released until 2008). Maybe you're thinking of the development of ActionScript 3.0 which had OO constructs and was supposed to be a replacement for JavaScript before (I believe) Microsoft balked and left Adobe hanging. Which is a shame because AS3 is also superior to ECMAScript 5 and world would have been better with AS3 in the browser (and don't get me wrong, AS3 is very quirky language).

But regardless, the whole "Google is trying to replace JavaScript with Java" was pure paranoia not grounded in fact.

> the issue (generally) isn't static typing but instead the cost/benefit involved

You can build in optional typing if you really want to (AS3 had that). Having said that, I cannot see what time you lose by enforcing type constraints. And dynamic languages are not faster or more productive. At best it's a no-op. At worst you're dealing with runtime errors which are 100x painful and costly than dealing with a compile-time error.

>There's a reason JS has spread so far

It's the lingua franca of the web because it's the only language supported by major browsers. That's why it spread so far, not because it is a great language. In fact, the plethora of transpilation tools should give you a clue how shitty this language is.


> But regardless, the whole "Google is trying to replace JavaScript with Java

A claim I didn't make. They TREATED Javascript like Java, and tried to adopt the behaviors. This generally works poorly in any language transition. I've seen Perl written like C, Python written like Java, Java written like Perl, etc, and it's always a bad thing.

> GWT was ....never a replacement for JavaScript.

I never said it was (You'll see a recurring theme in your responses here...). GWT, however, wasn't going to encourage me to trust Google's recommendations.

> Can you provide an example of this? [treating Javascript as Java] I have no idea what you're referring to

Ironically it's hard to come up with a lot of material from that time period, but generally you can see the number of libraries that would try to create Classical inheritance so we could use Java OOP conventions. Far too many books came out that would spend their first chapters creating such a library, and then use that library for all the rest of the book, meaning that if you want to write other styles or learn JS strengths and quirks, you were out of luck - instead you learned that JS does not do a good job of recreating a Java-like code structure.

> Google was a non-factor in the development of the web technologies and standards in the late 90s and early 00s

You are correct - my memory tends to forget how far away some of those experiences were. I was talking mid-aughts to 2011 ish. starting pre-Chrome, but going through Chrome, GWT, GWA). Google released the first generally used styleguide for JS, got vocal in standards discussions, etc. By the time Dart and NaCl came around (2011?) Google had established themselves as worth listening to, but also worth taking salt with (pun retroactively intended).

I mean, if someone shows up and starts saying the language is shitty and we should all be doing it differently, we're going to take whatever they say a little skeptically.

> I cannot see what time you lose by enforcing type constraints

Enforcing? Generally not much. Giving the info so the system can do it? Quite a bit. Not worth breaking down here, I'll just say that the market is clearly not convinced by your arguments, and you can dismiss them as idiots if you like, I'm just saying there are a lot of people that don't think static typing is automatically the best thing to do.

> how shitty this language is

A debate not worth having as you've clearly made up your mind. Nonetheless, to stick to the original point: Dart wasn't given a fair shake, but Google had not put themselves in a position to be considered a good source of "future of web dev languages across browsers" trust, despite their efforts to improve dynamic web apps and the browser space in general. I heard the "Replace Javascript with Java" rumors, but everyone that I respected disregarded that and instead focused on developing Javascript as Javascript. That doesn't always make their choices correct (ask me about CSS sometime!) but it does suggest that their reaction to Dart was not solely motivated out of a fear of replacing JS with Java. I myself was not a fan of JS when Dart was announced, but had no interest in picking up a Chrome-only feature, particularly when everyone focused on how it wasn't JS instead of how it would make my job easier. Not being JS is fine, but if it comes across as NIH because your bikeshed is better, I have little interest.


>A claim I didn't make. They TREATED Javascript like Java, and tried to adopt the behaviors.

Again, because you're making nebulous claims it's really hard to argue against. I still don't see how Google treated JavaScript like Java. I don't know what that entails.

>Ironically it's hard to come up with a lot of material from that time period, but generally you can see the number of libraries that would try to create Classical inheritance so we could use Java OOP conventions.

You must be thinking about the Closure Compiler[1], which was a transpilation solution driven by JavaScript comments which provided type and directive decorations around raw JS source allowing compile-time checks. All it was a proto-TypeScript. Do you think TypeScript is Microsoft attempt to treat JavaScript like Java, because TypeScript provides OO constructs (like classes, inheritance, polymorphism)? Because that's what you're saying.

>Ironically it's hard to come up with a lot of material from that time period,

And my argument is, you won't find anything, because there was nothing to it. It was irrational and emotional argument.

>I mean, if someone shows up and starts saying the language is shitty and we should all be doing it differently,

And they were right. For example, people complained about NaCL/PNaCL (sometimes for good reasons, it was a proprietary solution) but WebAssembly is the spiritual successor to NaCL/PNaCL. JavaScript is still terrible for writing large amounts of code and this is why people use TypeScript to make it palatable.

>I'll just say that the market is clearly not convinced by your arguments

I would respectfully disagree. And my counter argument is the popularity and plethora of transpilation languages and pre-processing frameworks for the entire browser tech stack (HTML/JS/CSS). If you're writing 100k lines of JS code, you're not writing it in vanilla JavaScript, unless you're a sado-masochist and you like pain. Front-end devs have also come around on static typing because you really don't know pain until you start dealing with what should be trivial bugs in a large application written in a dynamic language. Compile-time checks and AOT optimizations are incredibly powerful tools.

[1] https://developers.google.com/closure/compiler/


It's more than superficial, I struggle to see how using Dart would be at all different from how you would architect an app in Java. It's an OO language with an almost identical set of type system features besides the fact that it has inference. It's not as if it borrows much from the ML lineage; I don't see any examples of pattern matching and currying in the Dart docs. It's all class based polymorphism.


> I struggle to see how using Dart would be at all different from how you would architect an app in Java.

It's not really an architectural difference, I'd agree (outside of isolates vs. threads): Dart is mostly about ergonomics compared to other class-based OO languages. Unification of class, interface, and mixin; method cascades for “free” fluent interfaces; the syntactic support for sync and async generators along with async/await, really transparent (binary, not just source-level like C#) getters and setters; named and factory constructors; the whole deep consideration of const-ness, etc., are all ergonomic features, not major changes in architecture / paradigm.


So to you OO means Java?


> I think mostly because they were bit too hard by IE doing the exact same thing just a few years before.

It's pretty simple, in my view: JS developers were happy with the language and didn't want a browser vendor trying to replace it. Remember that it was announced around the time that the new ES6 ("Harmony") features were generating a lot of excitement about the future of JS.


I think Dart started internal development around the same time CoffeeScript gained major popularity and brought attention to JS's desperate need to evolve, but they released at a bad time: when JS finally did start to evolve (as Harmony) which was a reaction to CoffeeScript in the first place. So CoffeeScript served its purpose of pushing JS forward, and most other compile-to-JS languages had no more purpose. I say most because some serve a different purpose than just being a slightly nicer JS, like how Elm piggy-backs on the familiarity of Haskell and provides a niche no-mutation environment, and TypeScript adds type-checking for those of us who can't write code as confidently without it. But the rest served their purpose, and Dart's dream of having its own VM inside Chrome was probably what killed it so quickly.


If Google had paved some cowpaths:

- CoffeeScript was hugely popular at the time - it was even mandatory at GitHub to make new applications in CS not JS

- Typescript was immediately well recieved. JS folk liked optional typing.

- Ruby was popular amongst the web community

Google would have done a lot better than making a new road and wondering why there's nobody on it.


> - CoffeeScript was hugely popular at the time - it was even mandatory at GitHub to make new applications in CS not JS

We'd probably really be regretting that choice since CoffeeScript use is dwindling and the programmer ecosystem has generally turned towards static types.

> - Typescript was immediately well recieved. JS folk liked optional typing.

Dart was an optionally typed language and is actually older than TypeScript.

But, the original creators were very focused on getting a native Dart VM in browsers and were willing to sacrifice seamless JS interop to get that. There's good arguments for that since great interop often means adding ugly features to your language in order to play nice with the existing one. Dart was intended to be a bigger leap forward from JS.

If the VM wasn't part of the plan, then Dart probably would have hewed much closer to JS and been very similar to TypeScript. That probably would have been good for us then, but it might have been a limitation long-term. TypeScript is a really nice language, but it's got a lot of baggage that it inherits from JS.

Dart is, I think, a much nicer language if you don't need to reuse and interop with a big corpus of existing JS code.

> - Ruby was popular amongst the web community

Is the "was" part of that intentional? I like Ruby a lot, but it's luster seems to have faded some in the past couple of years.

I think what all of your points show is that if you pave cowpaths when doing language work, you end up optimizing for what users did several years ago. Languages take a long time to develop, so I think you have to aim for where you think users will be, otherwise you end up irrelevant by the time you launch.


> We'd probably really be regretting that choice since CoffeeScript use is dwindling

BecauseJS eventually got better and everyone moved to new versions and Babel. If you'd offered an alternative, maybe they would have moved to that.

> Dart was an optionally typed language and is actually older than TypeScript.

OK.

> Is the "was" part of that intentional?

Yep, a lot of Ruby folk moved to node, now they're in Elixir or Go.

> I think you have to aim for where you think users will be, otherwise you end up irrelevant by the time you launch.

I totally agree, but I think those cowpaths give you a good idea of where the ball is moving, particularly syntactically. And it doesn't seem like Dart paid any attention to that signal at all.


Lars (and company) approach to implement a Dart VM in Chrome was just ahead of its time. WASM is an attempt to accomplish a similar goal and implement a common VM. Perhaps, in the near future, Dart can be a syntax to compile to WASM and accomplish Lars' intentions.


Don't forget Clojurescript which heavily influenced the development of React. Clojure is unique in the landscape of modern programming languages.


What I don’t understand is why people are excited about the new features of JavaScript. The problem with JavaScript has never been that it doesn’t have enough features or syntactic sugar. The problem with JavaScript is that it has a rotten, unsafe core. Its very nature is antithetical to writing robust software, yet we need it to create dynamic UI applications.


I’m not convinced Javascript boils down to anything worse than other dynamically-typed languages.

Except it has features other langs don’t like async/await and async-everything.

This is why many people including myself use Javascript even on the server. For example, I’d consider Python a downgrade.

I point this out because it seems to be news to you that many people find Javascript pleasant and disdain for its “unsafe core”, whatever that means, extremely oversold.


> What I don’t understand is why people are excited about the new features of JavaScript.

They're excited because new features are useful to lots of people.


> I think what killed Dart is that they emphasized their plans to make Dart a first-class scripting language of Chrome, so that you could use <script type="text/dart"> instead of JavaScript.

Funny, that's what I saw as the core attraction. The fact that they never pushed for adoption in other browsers and fell back on transpilation removed the benefit you'd get from an alternative scripting environment.

Thankfully, we now have web assembly.


For me it was that google had burned all their credibility with me on GWT. I’m not taking any more career risks on their projects. Too much corporate ADD over there.


Flutter 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


Fabric and reason have a native render target that doesn't involve browsers or wrapping some other UI library?


Fabric is the effort to make RN more competitive.

And Reason is just another syntax for OCaml, so it can compile to everything OCaml can, that includes "native".


I was a backend/cli developer for Dart, most of us were ignored when we asked for support in helping build out the Node.js aspect of Dart. So many left. I still maintain my few libraries but I lost of a lot of interest when they went full throttle on frontend only until it failed.

I hope Flutter restores some popularity. If it does, those libraries will start getting updated.


AngularDart is a hard fork. You shouldn't compare version numbers with original Angular since they are independent projects now.


I wasn't aware of this , thanks for the info.

Nonetheless , the API seem to be behind the original. Hence interop with JavaScript seems incredibly messy and time consuming.


Even the APIs are not necessarily related anymore. AngularDart is an entirely independent project in every way. I'm a long-time AngularDart dev, and the JS interop thing isn't as important as you'd think. For one thing, it's actually not that hard to do, and for another, you don't need to very often at all, since Dart covers so much of what external JS packages do.


Well, google itself calls it now 'a client-optimized language' and product manager of Dart is also a product manager of Flutter at the same time, brought in from Microsoft. Tells you everything you need to know where they're aiming - where React (Native) is. The farm is bet on Flutter's success now, it seems.


It just doesn't provide enough value over Flow or TypeScript for most people. I'd love to use Flutter, but the tools I want to build I need to be desktop apps. Not everybody is focused on the app store gold rush.


With Google’s history of abandoning efforts like this, I wouldn’t spend too much effort using any language developed by them.


> With Google’s history of abandoning efforts like this, I wouldn’t spend too much effort using any language developed by them.

Well , to be fair Go is becoming a major server side language and I don't see Google abandoning it any time soon.

That being said , Dart is basically on "life support" has of now , there is no SDK what so ever beside Google + Firebase , and I haven't heard anything from AWS / Azure or others vendors to support Dart + Flutter.

I feel like everyone is basically waiting for the language to take off to actually invest in it.

I'm afraid it will end up like Xamarin , a niche tech that will eventually die out because very little people accept the ecosystem that is forced on them by using the framework.


Xamarin is not dead and being actively developed. It just doesn't intersect with the startup scene because of its enterprise roots.


You don’t need more AWS support really. You can use any language that technology that AWS supports as the backend for a flutter app.


Not if you want to use Lambda. You could write your own wrapper for the AWS API's for other use cases, but you could also repeatedly hit your head with a hammer.


I wouldn’t focus my medium term career prospects on Xamarin, but if I could quickly ramp up and do mobile development using it, I would.


From what I understand, AdWords is written in Dart. This alone means it's not disappearing anytime soon.


And the server component of iTunes and the App Store is written in WebObjects.....


WebObjects isn't open source, Dart is.


How has the open source nature of Dart helped so far?

Open source is not a panacea for a project that’s not popular and doesn’t have an active vibrant community around it.


Although it's not a guarantee that it'll stick around, the fact that it's open source greatly increases the probability.

GWT is actually still very much alive even though Google abandoned it years ago.


Is that something you are willing to bet a major architectural decision on and/or your career?

I’ve been a Microsoft developer for over 20 years and a .Net developer for over 10. Even though I don’t see .Net “dying”, it’s also not a major growth opportunity.

Java is definitely not doing well compared to .Net even though it is open source - because of the mismanagement of Oracle. I see dart going down the same road.

As much as I prefer .Net to the JavaScript ecosystem, I am tying my horse to it. I’m focusing my attention on everything JavaScript over the next year (yes it makes me sad).

Until four months ago, I had never touched Python. But the more I got into AWS, the more I realized that the ecosystem around AWS and Python seemed to be the strongest. So Python it was.


Despite the HN hate, Oracle is still doing a better service than Sun was on their dying years.

And lets not forget no one else bothered, beyond a timid attempt from IBM, which I think would have been probably worse as Java steward.

Google just hoped that Sun would have died in silence as way to settle their wrongdoings.


> Java is definitely not doing well compared to .Net even though it is open source

Depends on whather you consider Dalvik (or whatever the current Android Java tech is) to be Java - in which case, it is.


Market wise, Java is still popular in the Enterprise and of course if you are developing for Android, you’re going to probably use Java (I’d rather use Kotlin), but for backend work the three most marketable languages seem to be JavaScript (Node), .Net, and Java.

Yeah PHP jobs are a dime a dozen but they don’t pay well. Python is a little better but it’s not “Enterprisey” enough for major corporations and the cool hipster companies where all the money is going are using Node.


I don't know where you're getting your information about Python from. It's popularity has skyrocketed in recent years. Search Indeed's API for title:python and location:London. 412 Python jobs compared with 278 for Node.js. What's also interesting is that there are currently 35% more Django jobs than Rails in London whilst at Angel.co they're about even.


Well, if I ever want to move to London...

As I said, there are also plenty of PHP and WordPress jobs, but those aren't exactly paying top dollar either.

If you have to tie your horse to something. It makes the most sense to tie it to JS. Until something takes over JS on the browser, it's going to stay marketable. Then you consider Node for the server and the frameworks that you can make good enough mobile apps with JS has both marketability and flexibility going for it.

Then add TypeScript on top of it, you have a mostly strongly typed language.


As (primarily) a node user, there's way more data science an ML in Python than there is node.

If you're still tying your horse (and haven't already) it might be better to skate to where the puck is moving - Elixir would be a good example.


Which puck is that? There are very few Elixir jobs on most of the jobs boards I've seen and let's be fair - Elixir has now had long enough to build momentum. From the numbers I've seen Elixir clearly seems to have been eclipsed by Go.


There are no jobs for Elixer in my market.

Python is definitely something I’m going to keep in my tool belt if for no other reason AWS, Boto3, and Python go hand in hand.


Adwords frontend was completely rewritten in Dart. It's not going anywhere anytime soon.


Did you stop to think that the reason you like dart so much is that you're coming from javascript?

JS is not a real language, coming from python.


I 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).


How 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.


I 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 (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 :)


> 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 and scan a QR on your phone.


I prefer something that you can build yourself so expo wasn't an option for me. Plus, I think most of the platforms one day (might be soon) will ban these services as they can deliver code to the app after it has been approved.

With Flutter it's super easy, they have a CLI that creates an initial boilerplate for your code that you can compile and deploy to your phone in just a single command with hot reload enabled. I guess it makes it easier even than expo as you don't have to scan anything on your phone :)


Wait... we were talking about ease of access right?

Just re-reading the getting started guide for flutter, you need a set of tools, the flutter SDK, xcode etc.

That's not one command.

The same goes for React Native, you need node and xcode for building locally just like with flutter.

I am talking about the advantage expo offers to try React Native without any tools.

Heck you could try it in an iPad only if you'd want.


I didn't find it hard to set up, it's just once CLI that also has "flutter doctor" command that tells you if something is wrong. Since I already had XCode (as I was doing some work on Swift) and Android Studio, I didn't find it even a little bit annoying :)

What really made the difference for me was their CLI to build and run the app + batteries included approach where the router is available out of the box and you don't need to look through some GitHub projects on how to implement routing and authentication in your app. That wasn't the case with RN.

Also, in this setup, all the infrastructure is in your computer, no need for a cloud service like Expo. However, I do agree with you that if you just want to try something simple, it will be easier with it, it's just how much can you trust that service and why would you for something more serious?


Congratulations 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.


Flutter 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.


Depending on how far you want to stretch it Kotlin is cross-platform-ish.

You can write Kotlin that compiles to both JVM and JS, and KotlinNative claims to be able to then also compile that to native.

It's hard to do, and there's a major lack of abstractions even within the standard library, but technically possible. I could easily see a future where your business logic is portable kotlin and then you have platform-specific UI layers.


Yea but you can't develop for iOS using Kotlin. That's a big advantage for React Native/Electron/Flutter and JS world as a whole.


Yes, you can. Kotlin/Native targets iOS: https://kotlinlang.org/docs/reference/native-overview.html

And if you're going to consider JS as supporting iOS then KotlinJS works on iOS, too.

So Kotlin is doubly runnable on iOS as either native code or JS.


How 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.


re 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/...

  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.


Yep, 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.


The main negative with Flutter on iOS is that your app ends up looking like an awful Google app instead of something native.


There's a Cupertino theme.


Yeah, and in Flutter it's actually impossible to use system native UI libraries like navigation etc. So if you would like to build a simple app using each platform's native components, you'd have to build them yourself. (And update them as iOS/Android updates their UI).


> 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.


There'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.


Server-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


Right, 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.


Dart 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.


I'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?


> 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.


> 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.


This 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.


> 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).


I thought the Flutter SDK uses the Dart runtime to enable hot reload?


Anybody using only dart for their mobile apps, how has been your experience with it? Where does it triumph & fail over RN??


Pros:

* 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


To 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.


I would add on the Cons that Flutter is a bit more verbose than React-native since it does not have JSX. And also on the Pros that the community is much nicer on Flutter, RN is Facebook's own pet project and it's very visible when you run into issues.


Since 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.


My 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.


Thankfully, the community is really welcoming. Not like RN where issue are closed for no reason all the time..


It's been a pleasure to work with the past month. Traditionally I've worked with Cordova/Ionic and I feel far more productive than I have before on mobile. I was skeptical of the Dart language but now I've seen it's similarities with C# and really enjoy it. The whole widget model is pretty nice to work with too.

The experience of going from zero to HelloWorld with VSCode was so smooth. The community has done an excellent job with the VSCode extensions. Things like picking/install/starting an emulator is quick and intuitive as opposed to the work it takes to initially get thing Xamarin installed and running.

Hot reloading works well on a device or emulator and is really quick! There isn't support for remote updating (yet) once you've published to a store though. There is a GitHub issues tracking this.

I'm a fan. I hope the community grows around it.


Dart is a nice statically typed and compiled C-style language. If you have experience with another such language, it will feel like you already know Dart. The language compliments Flutter well, and the Flutter SDK makes it simple and easy to rapidly build a functional mobile app.

Lack of certain features, like reflection, in mobile Dart creates a rift in packages you can utilize in a Flutter app. There are a few warts in the type system, mainly around generics, and little things like the lack of union types and type aliasing.

There are also a few outstanding bugs that you might run into, which have had relatively long life since they were identified. The Dart team seems to be reluctant to add new features.

Also, managing state in Flutter is a little unclear: documents and videos from Google recommend four different ways to do so: explicitly calling setState(), Streams with StreamBuilder, scoped_model and the various third-party Dart/Flutter Flux implementations.

It definitely beats native development.


Language with "dynamic" type can't be called "statically typed".


Most languages I can think of have this type, from void* to dyn to bounding by the root of the type hierarchy. Not all languages. However, what is c, c++, java, rust, go, if not statically typed? Ambiguously typed? Seems like not a useful distinction to make.

I argue static typing is the ability to static type up to 100% of a program, not the exclusion of a dynamic type.


Rust doesn't have such type. And type annotations in Dart are optional - when programmers are not obliged to use them, guess what will happen? They do NOT use them. People are lazy.

Dart's types exist only on compilation step. You can try to use "strong mode" in theory, in practice you will never compile it with third-party libraries.


> And type annotations in Dart are optional - when programmers are not obliged to use them, guess what will happen?

The type system will infer a static type based on the type of the initializer.

In some cases, inference may fail to infer a type. Right now, that can silently give you dynamic, but there's a flag to make that an error. I expect before too long that will be the default behavior.


Rust has both raw void* pointers (within unsafe code) and the safe std::any::Any trait: https://doc.rust-lang.org/std/any/trait.Any.html


Trait is not a type, Any is just a custom trait. Types: https://doc.rust-lang.org/book/second-edition/ch03-02-data-t... You can create trait with name "Magic" or "Fuck" and it will not mean anything. Pointers is not a type also.


Ok, type bound. You can still easily pass around data whose type is not concretely defined at the compilation step. Unless you’re arguing that the dynamic type is actually static, in which case this whole conversation seems semantically pointless.


2 hours ago I answered it already. If you're another person who wants to convince me that Rust has same thing as Dart's "dynamic" type, then please make my code example to compile (without modifications, for literally ANY type, as in Dart) and I will say I was wrong.


Dart type or rust type? They refer to different things, which is the source of the confusion, but they're both strongly typed.

In any case, you're moving the goal post from "concrete type at compile time" to "can represent any type", which is inherently going to be specific to how the language defines types. This is not an especially useful type of dynamic representation so I'm not sure why it would be desirable.


There is no confusion. Rust doesn't have dynamic type and Dart does. That's it.

Any talks about special traits in Rust are offtopic, while code I wrote as example can't be compiled in Rust and can perfectly work in Dart.

I wasn't trying to argue about words or terms, I was trying to say the gist: Dart has dynamic type, so you can send to your function any type and this function will just use it, without any downcasting - language will take care about it; and Rust doesn't have such type: you can't even compile code which is trying to work with variables like you can do in dynamic languages.

But then all of that useless arguing... It's really funny when I see how people are trying to prove that Rust has same dynamic type as Dart. The very nature of these languages is different.


Pointers are certainly types in Rust, and although it's of course true that the Any trait is not itself a type, a reference to an Any trait (which is what you'd actually pass around) is a type.


Well, you can repeat it many times but it will not become true. I gave you link to the list of Rust types. Pointers are pointers, not types. Traits can have any name, their names mean nothing.


https://doc.rust-lang.org/book/first-edition/raw-pointers.ht...

    *const u32
(for example) is a clearly a Rust type -- a const pointer to an unsigned 32-bit integer, analogous to

    const uint32_t *p
in C/C++.

I'm not sure what you mean about trait names. The purpose of the Any trait is to make it possible to pass around values of any type and dynamically downcast them, as the documentation indicates. That is a safe analogue of casting a void pointer to another type.


To be dynamic, "Any" should be able to represent literally ANY type. As you can find, Any is a reflection-wise trait to work with static types. It's not something what you can use when you don't know type and language will dynamically convert it. You can't write

    fn example(foo: Any) -> u32 {
        foo+55
    }
as you CAN do in dynamic languages. Do you understand me now? Or we will keep talking about unsafe extra special types?


Please remember there's a genuine human on the other end, trying to have a respectful conversation with you.


Or there is a person who is trying to prove his offtopic point by some pedantic interruptions, which are far from the main idea of discussion.


You can do that if you change it to &Any and then downcast. See the docs for examples. If the issue is that you have to downcast, then your initial claim that Rust lacks void pointers was irrelevant even if true, since you also have to downcast a void pointer in C before you can perform operations on the type that it's actually pointing to.


You can't downcast it to anything you want, it returns an Option, void pointers in C are not certainly the same, it's unsafe.


I know. That's why I said it's "a safe analogue of casting a void pointer to another type".


> If the issue is that you have to downcast

It's the difference between dynamic language and language with synthetic type for reflections.


A pointer is absolutely a type in rust.

let i: u32 = 1;

let p_imm: const u32 = &i;

Look at the const u32 in the type position.

The rust book even refers to const and mut pointers as types.


const and mut are not types, it's modifiers of mutability. On both lines type is u32z


The asterisks in leshow's comment are being lost in the formatting, since HN uses them for italicization. So the last line, for example, is:

    The rust book even refers to *const and *mut pointers as types.


I really can't believe how stupid people can be to say "const" is a type. Even if Klabnik will say it into my face it will not be true, I don't care about the book he wrote.


leshow said that

    *const u32
is a type, not that 'const' is a type. HN's formatting removed the asterisk, as it uses asterkisks for italicization.


The asterisk was formatted out. Read the book, they are types.


So you can write "let x:const = 5"? if "const" is a type.


You were just told the formatting removed the asterisk. const isn't a type, but a const pointer is, so is a mut pointer. It says so in the book AND it's in the position of a type in the code. What other information do you need to convince you that you're wrong?


Dart isn’t statically typed, at least not in the times i’ve used it; it’s gradually typed.


It was optionally typed. Dart 2 is statically typed.


If you have a well-thought out argument, and not a quippy one-liner, I'd earnestly like to hear it.

Dart's developers think otherwise[1]:

> Q. Is Dart a statically typed language?

> Yes, Dart 2 is statically typed. For more information, see Dart’s Type System.

> With its combination of static and runtime checks, Dart has a sound type system, which guarantees that an expression of one type cannot produce a value of another type. No surprises!

> Even with type-safe Dart, you can annotate any variable with dynamic if you need the flexibility of a dynamic language. The dynamic type itself is static, but can contain any type at runtime. Of course, that removes many of the benefits of a type-safe language for that variable.

[1] https://www.dartlang.org/faq#q-is-dart-a-statically-typed-la...


> With its combination of static and runtime checks

Do you personally use it? That "strong mode" is a theory-only thing, it doesn't work with any real code, only with code you wrote without real third-party libraries.


You are, at best, confusing Dart 2 with Dart 1; strong mode was one of several Dart 1 modes, but, yes, it's possible to run into problems because dependencies weren't designed for it.

There is no option in Dart 2; everything is the equivalent of strong mode, which eliminates ecosystem problems.


I mentioned I've only tried Dart 1.x. Glad to hear it's changed in Dart 2.


> only with code you wrote without real third-party libraries.

Your claim was true several years ago, but since then the entire ecosystem has migrated onto the new strict type system. It was a monumental amount of work, but, thanks to lots of effort from our users, we're there.

Aside from a small number of more-or-less dead packages, you should be able to use any third-party Dart packages you want while still using the new type system.


C#, Scala, Kotlin, TypeScript, et. al have a dynamic type. As long as every type isn't dynamic, I think it's reasonable to claim you have static types.


Is C# statically typed?


Yes, it is.


I don't know.


Really happy to see this absolutely honest and neutral answer downvoted. It says a lot about the level of my opponents.


It says a lot that you consider folks you're having a conversation with "opponents".


Anybody who is arguing with you is your opponent. It's not so dramatic word :)


I work for a Danish city with 60.000 inhabitants, so we're a small team, and because of that we looked into flutter since it seems like an easy way to do mobile for people apt at c-like languages. We even had some internal talks about angularDart and flutter being comparable to react and reactNative.

Our proof of concept wasn't that much of a hit though. Flutter integrates really, really well with Firebase, but being the public sector in Europe, I don't see us using Google cloud anytime soon. Without it we couldn't really get a full stack dart thing running because stuff like aqueduct isn't mature enough, and is really hard to run within Azure. At least if you want to run comparable to other options seeing how application insights even works on Node.

Dart is a nice language, and Flutter is certainly an easy way to do mobile apps, but I don't see us using either, unless they becomes much more popular.


Why is the public sector in Europe staying away from Google but not Microsoft (Azure)?


Microsoft was a lot faster to accept and accompany our privacy terms. The EU data protection laws that you've seen all the fuzz about may be new for the private sector, but in much of the public sector we've actually been under much stricter requirements for years. If you have a big enough agreement with Microsoft, you can even have your data stored on servers you have physical access to and share with no-one else.

AWS was a little slower, but now meet the same requirements, pretty much. Other parts of the public sector is big in AWS instead of Azure.

Google only recently got into any type of real agreements with the EU on data protection, and they're still far from having national agreements. They also don't meet EU requirements on all their products, making it easier to blacklist all Google products than risk your GIS department using Google Maps or your PR department using Google analytics, both illegal for public usage.

For us personally we have more than 25 years of partnership with Microsoft, who have an excellent record on support. By contrast we've never really worked with Google, and we're not typically the ones to try new things. :) Especially not when we're happy with what we have, and since we already have a presence in Azure, I doubt we'll be expanding to another Cloud when pricing is pretty competitive between them. I mean, to run two clouds would also mean our operations crew would need to obtain security certifications for both, which is fairly expensive.

Technically and legally we could sign an agreement for Firebase in particular, and host our mobile apps with a Firebase backend, but as that's not likely to happen, Dart would need to become popular enough to integrate seamlessly and easily with Azure for us to use it.


One reason could be that from what I understand Azure licenses it's cloud software to other providers ("Azure Stack"), so you can get "Azure" run by a European company in an European data center, or even a state-owned one.


I 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


Now 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.


> The Dart language, libraries, build system, and web development tools have changed.

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


I 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.


That's because compiling non-C++/Rust-like language to WASM is unpleasant and associated with completely unneccessary overheads.


Who’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!


I 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.


> 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


You'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.


I love how Container takes 'child', but Column takes 'children'.


One must be singular, the other takes a list? Doesn't seem too crazy.


> 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.


And Swift


When 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.


Flutter is going to make/break Dart. If flutter takes off, Dart is saved. Otherwise, looks bleak.


I 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.


That 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.


When do you think flutter will support running on a stock Linux system?



Thanks, not officially supported.


I believe people are working on making this work, also getting it to work in browsers.


The Adwords frontend was just rewritten in Dart, so it will be around for a long time.


Dart'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://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.)


Between 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.


>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.


So we are going to ignore the slow 3g network aspect in the quote you are referring to then. Sigh.


The 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.


I 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.


This 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.


That 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.


With 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).


Dart does not use LLVM anywhere in its toolchain.


Anybody looked at flutter for Haxe?


> will be Flutter bindings implemented for other languages sometime

I hope so


They 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.


With Dart they can completely ditch the JVM and Oracle


Except 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.


> 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.


Isn't Fuchsia going in this direction? Languages used there: C, C++, Rust, Go, Dart, Python and.. (I think that's about it), with Dart possibly mostly for the UI.


Flutter 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.


I'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.


I tried 1.x and I regret for wasted time. TypeScript is better for every niche Dart is trying to fill.


I'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.


As 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.


I don't believe it exists, but in theory someone could write a Flutter plugin to evaluate JavaScript on V8 (Android) or JavaScriptCore (iOS).


i 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.


How's dart as a server ?


Try aqueduct! https://aqueduct.io/


I 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.


It'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.


This is great to hear!


Server side is not dead, just dont expect them to make a Ruby on Rails kind of framework.


Very comparable with node.


How so?


I 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...


"... the new keyword is now optional...".

Why optional and not deprecated?


Deprecating 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/usag...

[2]: https://github.com/dart-lang/dart_style


Is 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.


Dart 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.




The Dart always was my favorite Dodge.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: