Announcement

Collapse
No announcement yet.

Dart 2.0 Released As A "Reboot" To The Programming Language

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dart 2.0 Released As A "Reboot" To The Programming Language

    Phoronix: Dart 2.0 Released As A "Reboot" To The Programming Language

    Google developers spearheading the Dart programming language that is intended for general purpose programming, including web applications and can be trans-piled to JavaScript, have issued their second major stable release...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I started looking at the tour, I found this:
    Code:
    int lineCount;
    assert(lineCount == null);
    int are null by default, not 0, not warning, not error, just null;
    In practice this means even more NPE than java or C#. Why didn't they make NPE a syntax error like kotlin, swift and rust?

    Why would anyone chose Dart over say TypeScript?
    Last edited by paulpach; 07 August 2018, 11:47 AM.

    Comment


    • #3
      Originally posted by paulpach View Post
      I started looking at the tour, I found this:
      Code:
      int lineCount;
      assert(lineCount == null);
      int are null by default, not 0, not warning, not error, just null;
      In practice this means even more NPE than java or C#. Why didn't they make NPE a syntax error like kotlin, swift and rust?

      Why would anyone chose Dart over say TypeScript?
      As a person who previously worked full time in Dart and hoped for its expansion and now work full time in TypeScript and basically no interest in start using Dart again your questions appeals me.

      Null:
      Dart had a very very strong target of beeing familiar when it first launched. And they totally succeed. I've seen people familiar in Java, C# and/or Javascript start using and being productive in Dart the same day and writing very "Darty" code in less than a week. And languages most people are familiar with do have null problems. While I do think Rusts ways to (not) handling nulls is the best I've seen something like that would just not fit in their goal. You can argue that their goal was wrong but that is a matter of preference. They massively succeeded in what they tried to do.
      In terms of not defaulting: Dart doesn't have primitives, everything is an object. Javas Integer does also default to null. Sure you can do like C# and default object types but as you can't default everything you'll end up with consistency problems. Again you have a choice, this time between consistency and comfort. Dart is utterly constant. If you know 10% of the language you can extrapolate the rest. It's the most consistent language I have ever seen.

      There is a proposal for non-null by default, https://github.com/dart-lang/dart_en...sals/issues/30, the progress did stop to focus on Dart 2 and satisfy the needs of Flutter but I presume it will continue in the near future.

      VS TypeScript:
      While I do prefer TypeScript and think it have many pros over Dart, Dart does have many over TypeScript as well. Some I come to think of of the top of my head:
      1. Tooling. Dart have awesome tooling that just works. TypeScript does have great tooling but only after you have battled with Webpack, strangled Jest to use source maps correctly, debated build systems for Node for hours, rewritten parts of your code as you hit a bug in TS server that makes it eat 10x as much memory, etc. Dart always just work.
      2. Libraries. Dart have an awesome standard library with much higher quality than substitutes you find on NPM and it also have remarkable high quality in third party libraries that are written in Dart so they just work. TypeScript have much more third party libraries to choose between but their average quality is lower and most is written in JavaScript so you won't have any types or very low quality third party types.
      3. Consistency. JavaScript is a nice language, but consistent is it not. Oh, and their also isn't any dark corners in the language you must shy away from.
      4. Compatibility. Because Dart have a rich standard library, third party libraries are much more compatible. They rely on standard components instead of third party components from another library of which there are 200 choices of which 4 are quite common...
      5. Pleasure. Developing in Dart is just more pleasureful and probably much better for the heart.

      Comment


      • #4
        Pajn that would make dart inferior to languages like rust or elm , which have an small library ( besides interaction with the dom ) but a community that interacts with the devs and between each other to avoid overlap and get important packages done
        Last edited by GunpowaderGuy; 07 August 2018, 03:15 PM.

        Comment


        • #5
          Originally posted by GunpowaderGuy View Post
          Pajn that would make dart inferior to languages like rust or elm , which have an small library ( besides interaction with the dom ) but a community that interacts with the devs and between each other to avoid overlap and get important packages done
          I don't know what you are commenting on so I'll have to answer generally
          Elm is only in a pre release and haven't even had a new release for two years. I'm sorry to say it but that ship have sunk.
          Rust is probably the best designed language in existence but it is in a completely different sphere. Dart, TypeScript, Elm is web/UI oriented, single threaded async languages with a VM. Rust is a systems language. Sure its security and high level features makes it reasonable to use for far more use cases than classic systems languages but it is still in very different world.

          Comment


          • #6
            I really liked Dart, but Google killed it when they yielded to TypeScript. General purpose languages? We have more of those than I care to count.

            Comment


            • #7
              Originally posted by Pajn View Post

              As a person who previously worked full time in Dart and hoped for its expansion and now work full time in TypeScript and basically no interest in start using Dart again your questions appeals me.

              Null:
              Dart had a very very strong target of beeing familiar when it first launched. And they totally succeed. I've seen people familiar in Java, C# and/or Javascript start using and being productive in Dart the same day and writing very "Darty" code in less than a week. And languages most people are familiar with do have null problems. While I do think Rusts ways to (not) handling nulls is the best I've seen something like that would just not fit in their goal. You can argue that their goal was wrong but that is a matter of preference. They massively succeeded in what they tried to do.
              In terms of not defaulting: Dart doesn't have primitives, everything is an object. Javas Integer does also default to null. Sure you can do like C# and default object types but as you can't default everything you'll end up with consistency problems. Again you have a choice, this time between consistency and comfort. Dart is utterly constant. If you know 10% of the language you can extrapolate the rest. It's the most consistent language I have ever seen.

              There is a proposal for non-null by default, https://github.com/dart-lang/dart_en...sals/issues/30, the progress did stop to focus on Dart 2 and satisfy the needs of Flutter but I presume it will continue in the near future.

              VS TypeScript:
              While I do prefer TypeScript and think it have many pros over Dart, Dart does have many over TypeScript as well. Some I come to think of of the top of my head:
              1. Tooling. Dart have awesome tooling that just works. TypeScript does have great tooling but only after you have battled with Webpack, strangled Jest to use source maps correctly, debated build systems for Node for hours, rewritten parts of your code as you hit a bug in TS server that makes it eat 10x as much memory, etc. Dart always just work.
              2. Libraries. Dart have an awesome standard library with much higher quality than substitutes you find on NPM and it also have remarkable high quality in third party libraries that are written in Dart so they just work. TypeScript have much more third party libraries to choose between but their average quality is lower and most is written in JavaScript so you won't have any types or very low quality third party types.
              3. Consistency. JavaScript is a nice language, but consistent is it not. Oh, and their also isn't any dark corners in the language you must shy away from.
              4. Compatibility. Because Dart have a rich standard library, third party libraries are much more compatible. They rely on standard components instead of third party components from another library of which there are 200 choices of which 4 are quite common...
              5. Pleasure. Developing in Dart is just more pleasureful and probably much better for the heart.
              Thx for the explanation. Do you mind to share with us why you basically have no interest in start using Dart again?
              According to your explanations Dart is not that bad.

              Comment


              • #8
                Originally posted by Pajn View Post
                Rust is probably the best designed language in existence
                Compare and contrast: https://plorth.org/language/ https://doc.rust-lang.org/stable/reference/

                One of the Lisps if you want something more conventional. Go for something even more conventional and cleaner (albeit with a few warts that might, or might not get addressed in Golang 2). Either way, best design it's certainly not.

                Originally posted by Pajn View Post
                but it is in a completely different sphere
                WebASM...

                Comment


                • #9
                  Originally posted by theghost View Post

                  Thx for the explanation. Do you mind to share with us why you basically have no interest in start using Dart again?
                  According to your explanations Dart is not that bad.
                  If I may answer in his place: Dart doesn't have a killer feature anymore. It's just one of many languages now and one with little to no adoption at that.

                  Comment


                  • #10
                    Originally posted by theghost View Post

                    Thx for the explanation. Do you mind to share with us why you basically have no interest in start using Dart again?
                    According to your explanations Dart is not that bad.
                    Yet again I would have to provide a list of things. There is no killer feature that if Dart did this I would use it but instead a lots of smaller features of TypeScript that ways up its weaknesses.

                    1. Object literals. Not having to classify everything makes it easier to start something, to refactor and to create good solutions for specific problems. The class tree creates a lot of overhead that it doesn't repay later on.
                    2. Serialization. As objects doesn't come from classes, they have no logic and is just data. That makes it super simple to (de)serialize which is a very common task in Web or near-web environments as you have storage on server and client side, lots of network traffic, server and client side logging and more. Sure many languages have in built tools or good libraries to deal with this, but not having the problem in the beginning is even better.
                    3. Integration in the platform. The web is developed JavaScript first. I can directly access every feature of the platform with it while with Dart I either have to wait for it to be included in the core or develop workarounds myself.
                    4. Libraries. There are certain key libraries that are just so good that they influence the language choice quite a lot. React is one of them.

                    That's the most immediate that pop up. Number 2 might not sound important but I promise you that having developed basically the same things in Dart and TS, it is.

                    Originally posted by c117152 View Post

                    Compare and contrast: https://plorth.org/language/ https://doc.rust-lang.org/stable/reference/

                    One of the Lisps if you want something more conventional. Go for something even more conventional and cleaner (albeit with a few warts that might, or might not get addressed in Golang 2). Either way, best design it's certainly not.
                    It's of course at least to a part a personal opinion so you may not agree.
                    With that I did however also include the standard library in my judgement and Rusts standard library is awesome.
                    It's so well thought out with good restrictions in what's included and what not. Good primitives that integrates well
                    with other types in the stdlib and third party lib.

                    Go I think have glaring omissions that makes it pretty bad actually. One of those is the lack of generics.

                    Originally posted by c117152 View Post
                    WebASM...
                    With that Rust can be used for the web, it doesn't mean that it is a good choice however. You does not have access to any parts of the platform, sure you can set up FFI with JavaScript and develop integrations but that will always have the same problem as Dart I mentioned below + it's slow as it's not simply a jump inside of the JS VM.
                    And the language isn't well suited for the UI use case.

                    Developing a calculation intensive library in Rust and exposing it to JS with WebASM is a good choice, but developing your whole web app in Rust will never be a good choice.

                    Comment

                    Working...
                    X