Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Google Programming Software

Google Starts to Detail Dart 219

MrSeb writes "After waiting for more than a month, Google has unveiled its mysterious Dart programming language... and you're going to kick yourself for getting so preemptively excited. Dart is a new programming language that looks like Java, acts a lot like Java, runs inside a virtual machine like Java... but ominously, it also has a tool that converts Dart code into JavaScript. Language-wise, its features are unlikely to knot your panties: there are classes and interfaces, it is optionally typed (you can switch between untyped prototype code to an enterprise app with typing), the syntax is very lackluster, there's a very strong concurrency model, and Google is promising lots of juicy libraries that can be leveraged by developers. Basically, the language isn't meant to be exciting: in Google's own words, it's designed to be 'familiar and natural' — and indeed, if you write Java or C# code, Dart will probably feel very approachable."
This discussion has been archived. No new comments can be posted.

Google Starts to Detail Dart

Comments Filter:
  • When and if every browser on the market supports it.
    Until then it is just interesting.

    • It can be cross-compiled to JavaScript. So every browser will be able to support it right off the bat. Of course it would be slower than native Dart support.
      • There are several dozen languages that can be cross-compiled to JavaScript today. So far, none of them have become popular as replacement for JS in the browser.

      • by CODiNE ( 27417 )

        Which Google will add to Chrome once enough cross-compiled apps are out there. Then they get a huge speed boost and it forces everyone else to add a dart runtime to their browsers or lose the benchmark wars.

        • by LWATCDR ( 28044 )

          Except that the browser benchmarks will be written in JS.
          Very few people will be willing to take the performance hit that the cross compile might cause. If it is any slower they will keep living with JS for a good long time.

    • by jandrese ( 485 )
      There is a Javascript cross compile, but no word as to how well that actually works. My experience with automatic code generators/translators like this is that they usually work fine for trivial projects, but tend to collapse when given something even moderately complex. Given how much of a moving target Browsers are, I wouldn't hold out much hope for such a device to produce usable code on its first outing. If you're lucky it will work in Chrome and you'll just have to tweak stuff to get it to work in F
      • Doesn't CoffeeScript already do cross-compile from native to JavaScript, with quite a few proponents and examples of complex usage working fine?

        No idea as CoffeeScript is something on my to-look-at list, and seems to be difficult to use on Windows.

      • by catbutt ( 469582 )
        The whole point is to make it appropriate for complex apps.

        And you really think google would make it so you have to tweak it for IE?
  • .... but ominously, it also has a tool that converts Dart code into JavaScript.

    Sounds pretty mundane to me- What's so ominous about converting to JS?

    • As was said in a comment above, browsers are moving targets. Even for the HTML5 DOM there are sometimes two different way to access a certain thing depending on which browser. Isn't really hard to work around, but someone would have to constantly be updating the converting tool as new changes come out.
    • by bcmm ( 768152 )
      Writing Dart-only websites is obviously a bad idea. Writing stuff that will work an order of magnitude slower on JS browsers could seem like a sensible lazy solution to many, especially if Chrome continues to gain market-share.

      In the worst case, this could lead to everybody having to implement Dart, and the new de-facto standard scripting language being controlled by Google, who, running several of the world's most popular websites, can hardly be considered neutral.
      • Writing Dart-only websites is obviously a bad idea. Writing stuff that will work an order of magnitude slower on JS browsers could seem like a sensible lazy solution to many, especially if Chrome continues to gain market-share.

        Dart->JS might be slower than Dart, but I don't see any reason to expect that it'll be an order of magnitude slower than just writing it in JS would be, since much of it won't be replacing stuff that would be handcrafted in JS, but stuff that would be built on several abstraction

      • Writing Dart-only websites is obviously a bad idea. Writing stuff that will work an order of magnitude slower on JS browsers could seem like a sensible lazy solution to many, especially if Chrome continues to gain market-share.

        I don't think anyone has yet suggested writing "Dart-only websites." From the blog:

        The Dart VM is not currently integrated in Chrome but we plan to explore this option.

        "We plan to explore this option" could be interpreted in that light, but I take it to mean that they're still in a pl

      • Writing stuff that will work an order of magnitude slower on JS browsers could seem like a sensible lazy solution to many

        well, that's possible if they happen to do a terrible implementation of the compiler, but the intent would that it's faster as it can output optimized JS code.

  • It's not a bad thing (Score:5, Informative)

    by i kan reed ( 749298 ) on Monday October 10, 2011 @11:55AM (#37664284) Homepage Journal

    The world actually needs more "enterprisey" languages. If you want experimental, fun languages, your choices are actually very good, what with ruby, python, and a ton of functional languages. In terms of safe and good for scalable, risk-averse environments, there's pretty much just Java and C#. Java seems to have accumulated so much inertia, it doesn't add new features anymore. As for C#, the problems dealing with Microsoft are well-known to the slashdot community already.

    A little more competition in that arena would do the industry some good.

    • by wzzzzrd ( 886091 )

      Exactly. In terms of "heavy enterprise", meaning the real back ends of big financial companies, airline conglomerates and insurances...They only let you touch their valuable cobol systems through java, mostly 1.3 (1.4 if you're lucky). The java 5 route (and thus 6, 7, 8) is too risky because of Oracle. Any new development in that sector is good news. Although some java integration is necessary (mostly connectors and MQ systems), because these are tested for 10+ years and that counts more than anything else.

    • In terms of safe and good for scalable, risk-averse environments, there's pretty much just Java and C#.

      If by "risk averse", you mean "will only use what at least 1/4 of the rest of the people doing the same thing are using because it needs to be 'established'", then you'll never have more than a couple of options at best.

      If you mean any other sense of "risk averse", well, you can probably add Erlang to that risk, and several other things.

      In any case, it'll take quite somet time before any newly-created lan

    • ... and the problems dealing with Oracle are currently becoming obvious.
    • by JustinOpinion ( 1246824 ) on Monday October 10, 2011 @12:58PM (#37665492)
      I agree, but in such cases, isn't the solution to make current "fun" languages more "enterprisey" by improving the back-end toolchain? Disclaimer: I'm by no means an expert (I'm a physicist with a minor in CS, not a hardcore CS person), so maybe I'm way off-base here (corrections welcome).

      Take Python. I love its syntax, the plethora of libraries available, the ability to rapidly prototype and see immediate results. All the things that make it "fun" really do make it productive (shorter time to a final, correctly coded solution). It's a great language. However, it doesn't run as fast as C/C++ code, for obvious reasons (interpreted, dynamic typing, etc.). There are ways to make it faster (rewriting critical subsections in C/C++, using fast libraries intelligently, various optimizers and pseudo-compilers exist, etc.). But everyone (or at least me) would love to code using Python syntax but have the code run as fast as C/C++. Best of both worlds.

      In other words, what I would love to see is tons of effort put into making toolchains for making Python (or other "fun" languages) faster (and probably by association more enterprisey in terms of being type-safe, etc.). I'm not saying doing this would be easy, but there are various proofs-of-principle for compiling Python code or automatically converting it to C/C++ code and whatnot. It could be done and would allow programmers to use the clean syntax of Python to more rapidly code a project without feeling bad about the performance not being up to scratch.

      Again, I'm aware of the alternatives (rewrite bottlenecks in a fast external, etc.). But it seems to me that we've learned a lot about what makes for a nice high-level syntax, so we should automate the grunt-work of converting that syntax into fast low-level code. (Yes, I'm aware of gotchas such as dynamic typing preventing full compiling in some cases, but something like adding type hints to a high-level language would surely be less onerous for programmers than going to a lower abstraction level wholesale. Even type hints could be automatically inferred by a parser in a lot of cases, with a programmer checking that they make sense...)
    • And why must "fun" and "enterprisey" be exclusive? If your definition for enterprisey is scalable and risk-averse, why can't a language that is pleasant to use meet those requirements?

      I maintain hope for a language, compiler/runtime, and library that allows me to easily communicate my solution without being distracted by the language implementation (fun), while offering good performance and scalability. As for being risk-averse, there are never any guarantees there and I doubt you'll find that the great s

    • If you want experimental, fun languages, your choices are actually very good, what with ruby, python, and a ton of functional languages. In terms of safe and good for scalable, risk-averse environments, there's pretty much just Java and C#.

      Do you have any idea how much financial code is written in Python? I take that back, because it's obvious you do not.

  • I would describe it more as "a funny feeling".

  • by fnj ( 64210 ) on Monday October 10, 2011 @11:57AM (#37664326)

    Both the article and the summary don't seem to get it. This sounds like C#.NET take two, with the added trick that until browser support for the real Dart is there, you can deploy by translating your client side Dart code to JavaScript.

    • Re: (Score:2, Interesting)

      by gbjbaanb ( 229885 )

      just great... Java took at the 'best' ideas of C++ and then mangled it into something pretty nasty - a memory and resource hog with poor performance, especially for GUIs, and added non-deterministic finalisation (eventually - the original didn't even have that!) with verbose OO code everywhere. The only good thing it gives is a huge set of libraries.

      C# took that and did even more to it, so much so that you require an IDE to write code.

      So what does Google do? Take these languages and builds on top of them ev

      • Why don't they go back to the source, learn the mistakes that Java made ... and create a language initially based on C++ with the good bits of that included.

        let me guess. c++ developer?

      • You cannot take C++ and mangle anything since C++ is a Frankenstein language to begin with. Only it's inventor and the deranged could possibly love it. As for memory hogging, there are plenty of C++ apps that are memory hogs. And please, poor performance in Java? Java is one of the fastest languages on the planet. The only languages that even compete with it are C and C++. Apparently you get your information from the 1990's.

        Oh, and last I checked...the vast majority of C++ developers use an IDE.

      • Why don't they go back to the source, learn the mistakes that Java made (yes, some were just design decisions, others were due to the limitations of computing back then) and create a language initially based on C++

        The only way you could "learn the mistakes that Java made" and then "create a language initially based on C++" is if the purposes of learning Java's mistakes was so that you could repeat them.

        Modern C++ is pretty good

        Modern C++ may good for some things, but they don't seem to be the things Dart i

      • C# doesn't need an IDE to write code. It's plenty easy to write and compile projects outside of the IDE. All it requires is a little research, but you can't honestly decry that with a straight face now can you? Or were you born with the knowledge required to compile C/C++ projects at the command line? Microsoft even provides a shortcut to the visual studio command line environment when you install it for christ sake.

        Just because they give you the tools doesn't mean you are forced to use them (not that I kno

    • by Dr. Tom ( 23206 )
      funny, I liked the Go language they developed
  • by goruka ( 1721094 ) on Monday October 10, 2011 @11:58AM (#37664348)
    The main problem of Java and C# is that they are controlled by Oracle and Microsoft respectively, both of which have repeatedly shown to not play nice with the open source developer community, have used patents aggressively and care very little for open standards.
    Even mono is not open enough to allow usage in many embedded devices (read: game consoles) without paying royalties, due to the GPL license.
    A replacement for those that is portable, can be used everywhere, is easy to migrate to and is distributed by the very permissive licenses Google always utilizes sounds extremely good in my view, so I think the negative tone of the summary is misplaced..
    • Whoa there (Score:5, Insightful)

      by SuperKendall ( 25149 ) on Monday October 10, 2011 @12:15PM (#37664684)

      The main problem of Java and C# is that they are controlled by Oracle and Microsoft respectively

      But Dart is controlled WHOLLY by Google. Why is that really any different or better?

      The reality for Java is much better, it's controlled by a community standards body (the JCP). Oracle can provide direction but they are NOT in control the way Microsoft and Google are.

      • by goruka ( 1721094 )
        RTFA and the links to Dart website, Google intends to submit it to become an open standard. Also you ignored the patetns and very permissive implementation points.
        • by caywen ( 942955 )

          That's what Microsoft did with C# and the CLI, too. Either we believe that our open standards bodies are real, and that standards are indeed standards, or we believe that they are corruptible by corporations and nothing is actually standard, or we believe that somehow Google is an incorruptible paragon of holy perfection.

          I understand the reasoning behind the first two. I think the third might indicate substance abuse.

          • Microsoft did standardize C#, but actual development of the language and tools moves so fast that non-MS implementations always lag. And MS only supports Windows (by design).

            Time will tell, but I think we can expect Google to actively support all of the platforms Chrome runs on, and to release full source code under a fairly permissive license. An open standard plus an open source, multi-platform reference implementation will be truly open in a way that C# isn't and Microsoft doesn't want it to be.

      • I think Google is taking this from MS's playbook. They certainly have embraced JavaScript. Now they make there own language that can be compiled to Javascript, but also run natively. How long before they add features and syntax to Dart that can't be compiled to efficient JavaScript, but run blazing fast on Chrome?
    • by dintech ( 998802 )

      The main problem of Java and C# is that they are controlled by Oracle and Microsoft respectively

      Google is still pretty young, you haven't given them enough time to become utter bastards yet.

    • by caywen ( 942955 )

      In the world of programming, you choose your poison and insist to everyone that you are feeling fine.

    • Isn't C++ portable, can be used everywhere, is easy to migrate to and is distributed by a very permissive license?
  • by AC-x ( 735297 ) on Monday October 10, 2011 @12:02PM (#37664426)

    but ominously, it also has a tool that converts Dart code into JavaScript

    No, that's an excellent feature. Allows us to start developing sites with this new language without having to wait for all browsers to upgrade or to have plugins installed. How else would you get any sort of main stream takeup of a javascript replacement?

    • by LWATCDR ( 28044 )

      Yes and no.
      Unless Dart is "much better" why take the time to learn a new language where support will depend on two codebases. You will have your Dart code and your js translation of your Dart code?
      If you know JS your going to keep developing in JS until Dart support is proven and universal.
      Even then you will probably keep using JS unless you start a new project.

      • by AC-x ( 735297 )

        I don't see why this is any worse than a compiled language (Java, C# etc.), it's not going to be hard to manage your sourcecode and the JS output if you've got an automated build of your web project set up.

        Having done a lot of big projects in JS for me it has a lot of shortcomings and it would be great to have a replacement language that is backwards compatible. Sure I wouldn't do anything enterprise level for a year or so while Dart proves itsself, but I would happily use it for large projects before wides

        • by LWATCDR ( 28044 )

          It comes down to time for most developers. For instance I need to filter a large text file a few weeks ago. I have been thinking about learning Python because it seems pretty interesting. Time ticks buy as I am reading and setting up things and then I think, " if I used perl I would have been done". So I write the four line perl script and I am done.

          A tool just needs to be a lot better to be worth the time sink. A lot of the time Good enough is just that good enough.

          • by AC-x ( 735297 )

            To a degree, but if everyone stuck to this mindset then everyone would still only be using the first language they ever learnt. It's like saying that no-one will ever use Java or C# because they know PHP and it's "good enough".

            Dart has many nice features that would be very useful for large multi-developer projects (typing, static checking etc.) which would easily offset the time for developers to familiarise (one of the design goals of Dart is that it is easy to learn from a javascript background anyway).

            • by LWATCDR ( 28044 )

              Ahh but PHP isn't good enough for desktop applications. To change tools it must be much better or you have no other choice.

          • " if I used perl I would have been done".

            And if they would have spent this time, effort, and money on Parrot... You, the Python coder, the Lua coder, and the insert Parrot supported language [parrot.org] coder would have been done.

          • Well, it should be obvious, but I'm saying anyway: Wait to learn Python when you have a problem that isn't The One Thing one of the languages you know shines at.

            When you need to filter a text file, please do it in Perl*, not Python. That is good advice even for Python programmers.

            * Or Haskel. It is amazing how good Haskel is for filtering text. But, of course, you need a completely different mindset than you'd use with Perl.

            • by LWATCDR ( 28044 )

              True which is why I picked Perl. To me scripting languages like Perl and Python are the tools I use for simple one off programs like filtering a text file.
              I do not do much web stuff right now but I could see me using Python along with Perl and PHP.
              For anything more complex on the desktop I would use Java, C++ or ObjectiveC.
              If I need to do anything with or very old dos codebase I would breakout FreePascal.
              You see it is a need to learn thing.
              Now Haskel does interest me but when I have looked at it my head hur

              • I find that Python is quite usefull for writting any kind of fancy UI. It is simlper to write in than C++ (or Java, how can a garbage collected language be harder to write in than C++?), and yet, it doesn't collapse at its own weight like Perl or PHP. I guess that is some of your more complex stuff, so I'd recomend you learn python next time you go out to use QT or do web development (or more complex UIs, like what you can do with PyGame or 3D modellers).

                PHP by its turn, I now consider defunct.

                I looked at H

                • by LWATCDR ( 28044 )

                  I am just not a big fan of C++ but I mostly used it on Windows so that may have tainted it for me. Java+Netbeans makes writing GUI software really easy for me. I also find Java's tread support very robust. It could just be that it fits my style.

                  Perl I do agree is good for programs under 100 lines long and that you will never touch again.
                  However for plowing though a bunch of data it is a great tool.
                  I really like ObjectiveC. It seems far less like a Hack to me than C++.

      • by Junta ( 36770 )

        The key here is I'm willing to believe Dart can be 'much better', because really, being 'much better' than Javascript is a pretty low bar.

    • by dintech ( 998802 )

      Dart code into JavaScript

      Yawn, we've seen this before with GWT for Java. Wake me up when it has code to convert Dart into Bacon Sandwiches.

    • It's becoming obvious that browsers need to support a runtime like LLVM in addition to or instead of javascript. That way, the developer could use their language of choice and just compile to LLVM byte code instead of to javascript. I would think it should be easier to optimize performance for LLVM byte code that for javascript. Would there be any downsides except for the fact that it does not exist already?

  • by Animats ( 122034 ) on Monday October 10, 2011 @12:25PM (#37664846) Homepage

    The ominous part of that memo is "The cyclone of innovation is increasingly moving off the web onto iOS and other closed platforms." By which they mean iPhone and Android "apps". "Apps" are not a very good environment, and many of them are just web pages with delusions of grandeur. But that they have a payment model, DRM, and give the app distributor absolute control.

    It's all about screwing the end user. "You're the product, not the customer".

    As a language, Dash looks mediocre, as the article points out. "Optional typing", an idea that started with Visual Basic is usually a lose in language design. Statically typed languages have been successful, and dynamically typed languages have been successful, but optional typing is usually an afterthought bolted on to increase performance at the cost of programmer confusion. There's a typed Python variant, for example; PyPy is written in it. It's rarely put in a language from the beginning.

    A few languages have tried a form of soft typing, where you have, essentially,"integer", "real", "boolean", etc., and arrays of same, plus "object". That way you get efficient code for machine arithmetic, which means you can do codecs and graphics in the language. Objects have to be dispatched anyway, so a performance penalty there isn't so severe.

    • sorry, but did this,

      But that they have a payment model, DRM, and give the app distributor absolute control.

      and this

      It's all about screwing the end user.

      go together?

      having a payment model doesn't screw the user, it gives the developer a way to feed their family. as to the user, it's up to them if they want to pay or not. nobody is screwed.

      at least on android, there's nothing special in the platform that forwards DRM. android does have a "license verification" API that allows developers to validate that users actually purchased the app. see point above about feeding the family.

      on android, the "distributor", by which i guess you me

      • by 21mhz ( 443080 )

        at least on android, there's nothing special in the platform that forwards DRM. android does have a "license verification" API that allows developers to validate that users actually purchased the app.

        Actually, any serious pretense to verify the legitimacy of copying a bunch of bits to the device can only be done with a technology that amounts to DRM, requiring device lockdown all the way down to the bootloader. So either Android is claiming their verification to be more than it is, or it forwards DRM.

  • I have this idea of a new language that is 100% Javascript-compatible. It would require no code conversion whatsoever, works with your existing tool chain, and requires no new learning. It started out from an Ada-like project, and I dubbed it "New ADA", or "NADA". It's evolved quite a bit and doesn't look like Ada anymore. In fact, it looks exactly like Javascript. But it's new! I recommend that everyone start using Nada as soon as possible to open a whole new world of possibilities.

  • by Dr. Tom ( 23206 )
    no, seriously, didn't Google just abandon the Go language?
    • by burris ( 122191 )

      I thought Go was just a project of some Google engineers and not an official product.

  • The corelib looks very sparse: http://www.dartlang.org/docs/api/index.html [dartlang.org]

    The thing I like about jquery and dojo is that you actually get a reasonable standard library, which JS sorely lacks. It would be nice if dart included a better standard library.

  • GWT rocks - don't expect it to go easily into that good night.

    Consider the following scenario:
    o Convert the compiler to accept Dart instead of "pure" Java. Remember, GWT does not implement the entire language, only a subset of the run-time. This conversion can easily be implemented as a rolling replacement to the compiler.
    o There's absolutely no reason now for GWT to support Java 7+
    o The Google Plugin for Eclipse will easily convert to Dart, keeping the developer mind-share
    o Keeps all those nifty 3rd party

  • by sgt scrub ( 869860 ) <saintium@NOSpAM.yahoo.com> on Monday October 10, 2011 @12:57PM (#37665478)

    If Google would have spent time and effort on Parrot or helped to release a VM that interprets multiple languages under the MIT license, I would be loving Google. Another scripting language and VM doesn't make me warm, fuzzy, or even remotely interested.

    • Look up PNaCl. To be honest, I'm somewhat disappointed that this Dart thingy isn't running on top of that.

      • Salt, Pepper, Pinnacle are for pluggins and JIT'd C. I want a virtual machine designed to efficiently compile and execute bytecode for dynamic languages [parrot.org] built into the browser instead of a JavaScriptVM.

        • If you have a low-level VM (such as LLVM, which is what PNaCl uses), you can always build something higher-level on top of that - be it bytecode interpreter, JIT compiler or whatnot. You could take Clang and compile Parrot to LLVM bytecode for example.

          On the other hand, it also lets one use compiled languages. It's all about having more options.

          • "It lets one use compiled languages." Yes, LLVM absolutely does. I love it. It also allows one to create JIT's for high level languages. Jade, Crack, Rubinius, etc... are all done with LLVM. However, a JIT for a language is far from an anylanguageVM. I would call it an HLVM but that name was taken then absorbed back into LLVM. What I'm talking about is an interpreter that interprets more than JavaScript not a JIT for each language. There is a huge difference. Yes, one could use LLVM to build one.

  • The real reason Google is developing the Dart language is to hedge their bets in case they lose the frivolous lawsuit filed by Oracle. Rather than pay royalties to Oracle they will make Dart the primary development language for Android. They will make Dart compile down to Dalvik bytecode (chances are, they've already done this) and they might even offer developers a tool to translate Java source to Dart source.

    Remember, Dalvik bytecode is not Java bytecode. Android only uses the Java language, not its v
    • Remember, Dalvik bytecode is not Java bytecode. Android only uses the Java language, not its virtual machine, which is why Oracle mistakenly believes they can sue Google over its use. Changing the source language removes the perceived violation without breaking existing software.

      Mistakenly? I'm pretty sure they *are* suing Google over its use.

    • by Raenex ( 947668 )

      You've got some faulty assumptions. One of the reasons Oracle is suing Google is over the Dalvik implementation and patents:

      http://en.wikipedia.org/wiki/Dalvik_(software)#Licensing_and_patents [wikipedia.org]

  • I was really hoping that they included something like Ruby's mixins. I'm sorry, Google, but I'm not interested.

    • I was really hoping that they included something like Ruby's mixins.

      Interfaces are useful for static checking, since they express an implementation-free contract; this makes them important for Dart.

      Mixins might be useful in addition to interfaces, but don't fill the same role. Its also early in the game for Dart, unless there is a philosophical opposition to having mixins, they could well be added in. Maybe you should recommend that on the forum on the dartlang.org website?

Math is like love -- a simple idea but it can get complicated. -- R. Drabek

Working...