back to article Google's JavaScript assassin: Web languages are harder than VMs

The problem with programming languages is that everybody’s got an opinion - just ask Lars Bak, the Virtual Machine guru who is building Google’s planned (by Google at least) replacement for JavaScript. Bak has spent 15 years working on object-oriented VMs (virtual machines) at Google and Sun Microsystems and notched up 50 …

COMMENTS

This topic is closed for new posts.
  1. Malcolm 1

    VM

    I would have thought a language-agnostic browser VM (something like LLVM, CLR etc) would be better than another language. Write in whichever language you fancy and compile to the VM's instruction set and off you go.

    1. Ru

      Re: VM

      We've ended up in the slightly surreal situation whereby javascript has become some sort of web assembly language... there's a vanishingly small chance of anyone agreeing on upgrades to javascript or substantially different new platforms, so instead we're ending up with languages like Typescript and Clojurescript and Coffeescript which "compile" to javascript because most people actually have browsers which support it.

      Seems daft, but at least you have a bare minimum of choice and can reasonably expect to be able to run your code on most browsers. A new VM, supported by Webkit, Chromium, Mozilla and Microsoft? I'm not going to hold my breath.

      1. Anonymous Coward
        Anonymous Coward

        Re: VM

        " there's a vanishingly small chance of anyone agreeing on upgrades to javascript"

        Indeed, but it would be nice to have something supplant or rather compete with JS in the browser (so long as it looks and smells nothing like that VBScript abomination).

        It would be nice to have the option of prototype and OO. But the chances of it happening wholesale and any-time soon are slim to none - more's the pity.

        I for one fail to understand why so many developers out there are so mentally entrenched with JS that they decry any effort to introduce anything new.

        1. Ru

          Re: VM

          I for one fail to understand why so many developers out there are so mentally entrenched with JS that they decry any effort to introduce anything new.

          Stockholm Syndrome? ;-)

          No... this is just corporate politics at work. Look at the brouhaha around Javascript 2/ECMA script 4.... same arguments about develepers but largely not by developers.

          The cynical side in me also wants to point out that current web "standards" like javascript and CSS and the like have "less than brilliant" compliance across all platforms. Adding a new and complex standard like a new bytecode language? Even if the big browser manufacturers wanted to support such a thing, do you suppose they'd do a good job of it?

          1. Anonymous Coward
            Anonymous Coward

            Re: VM

            "The cynical side in me also wants to point out that current web "standards" like javascript and CSS and the like have "less than brilliant" compliance across all platforms. Adding a new and complex standard like a new bytecode language? Even if the big browser manufacturers wanted to support such a thing, do you suppose they'd do a good job of it?"

            You know, I could not agree more with everything quoted above. But are they valid reasons not to pursue such a goal? I'm not so sure. Is JS the pinnacle of what client-side could be? Far from it!

            Either way, I would still like to have the option of prototype and OO and think it's a goal worth setting.

            1. Adam 1 Silver badge

              Re: VM

              If it is only about the lack of typing, then surely something like typescript is a better option.

              Another VM just sounds like JVM, Flash, Silverlight etc and will end up with the same problems.

              1. P. Lee Silver badge

                Re: VM

                > Another VM just sounds like JVM, Flash, Silverlight etc and will end up with the same problems.

                There is a difference. If it also compiles to javascript, then you only write once and just load either dart or JS into the browser an request. The VM's mentioned above have platform limitations.

                Google has enough of the browser market via chrome and (more importantly) android to make this work. This might make web apps (which are horrid enough on a pc) work faster so mobile devices can run them.

                As long as it compiles properly to JS as well, google can afford to go it alone. If gmail runs faster under chrome than anything else, so be it, hotmail doesn't need to come along for the ride. You might eat more memory running a JS VM and a Dart VM, but memory is cheap.

                The aim of dart/NaCl etc is to get web apps running at a decent speed to bypass MS' grip on the desktop.

        2. Anonymous Coward
          Anonymous Coward

          Re: VM

          Too many dickheads at companies like Google, Microsoft and Apple that's why.

          Look at what happened with HTML5 video, nobody could agree on a standard. Google pushed their standard against Apple and Microsoft.

          What should have happened is a central impartial organisation should have proposed it and everyone adopt it.

          Google will push a standard which gives them some control or advantage over Microsoft and Apple. Microsoft and Apple will do the same.

          1. Steve Knox
            Meh

            Re: VM

            a central impartial organisation

            I think I saw one of those riding a unicorn once...

    2. Kubla Cant Silver badge

      Re: VM

      A language-agnostic browser VM sounds like an excellent idea. The variety of languages targeting JVM, which was probably never supposed to be language-agnostic, suggests this would be very productive approach.

      One would also hope that such a VM could take care of the security issues that are always lurking in the shadows when programs run in the browser.

    3. DrXym Silver badge

      Re: VM

      LLVM isn't really a VM per se as set of portable low level instructions which can be translated into an equivalent set of native instructions. So a browser could download bitcode and compile, cache and execute the native or it could run the bitcode through a JIT compiler each time. It could also instrument the native code with any security checks it liked to keep the app in a sandbox and prevent it busting out.

      Browsers *really* need something like LLVM. It's crazy that tools like Emscripten, GWT etc compile one language into a scripting language where performance is really awful. If code were compiled to bitcode it could run at near-native speeds and do so in a way which is browser and OS neutral.

      Google promised something called PNaCl for ages which would implement LLVM in their browser. It's emerging from development but it's still too early to say if it's portable to other browsers, or even if they'd be inclined to support it. I doubt Microsoft or Apple would support it though Mozilla might.

      Regardless of politics this is something that browsers really need.

    4. Anonymous Coward
      Anonymous Coward

      Re: VM

      Somebody has actually ported an x86 VM environment to Javascript and you can now boot Linux in your browser :-)

      http://bellard.org/jslinux/

      (a bit slow, as you can imagine)

  2. JDX Gold badge

    Of Course!

    The best thing to replace JS, a browser-specific language without decent dev tools, is not an existing language used across desktop & server platforms with a mature set of tools and proven track record, but ANOTHER new language. Because we don't have enough of those already.

    1. Anonymous Coward
      Flame

      Re: Of Course!

      Well, Java proves to be a bug-riddled ball of crap, worthy of M$. There is little hope it will ever be reasonably secure to run untrusted code. JS suffers from too many bad design decisions.

      A memory-safe language is required, so they create one of their own. Sounds reasonable. I do think, there should be more attempts like this to fuel the fire of language darwinism.

      Picture: A fire of burning language specifications.

      1. JDX Gold badge

        Re: Of Course!

        Java isn't a bug-riddled piece of crap, one particular implementation is.

        If existing languages are all unsuitable, how come we haven't all switched to something new? The last new language to get mass acceptance was C#... even Python and Ruby remain bit players.

  3. Neil Barnes Silver badge
    Stop

    Just as long

    as noscript stops it running...

    1. timetraveler
      Thumb Up

      Re: Just as long

      Sometimes, I wonder if all these Javascript performance improvements brought anything of value to normal users. Most JS is just tracking upon tracking for advertising reasons.

  4. Captain TickTock
    Stop

    "a prototype-based language"?

    from http://www.dartlang.org/

    "FAMILIAR

    Dart is a class-based, object-oriented language..."

    1. vic 4

      Re: "a prototype-based language"?

      Unless the article has been corrected the article does say that dart differs from javascript in this respect, i.e. not prototype based.

    2. diodesign (Written by Reg staff) Silver badge

      Re: "a prototype-based language"?

      Oops, some wires crossed. It's been clarified.

      C.

  5. Matthew Smith

    Death to Javascript

    Any language where ("0" == false) resolves to true is just plain wrong. Javascript is only used because theres currently no in-browser alternative, not because its any good. So good luck to Dart to try and displace it. It can't do a worse job.

    1. MayorBoris

      Re: Death to Javascript

      I dunno, in a language where strings and numbers are interchangeable to some extent (eg you can add them together), then it makes sense that if 0 resolves to false (as it does in C/C++), then so should "0".

      Having said that, it's about time we had a decent, fully oo, client-side scripting language.

    2. logantuk
      Boffin

      Re: Death to Javascript

      Why not use the type equivalent operator ("0" === false) ?

      1. Matthew Smith

        Re: Death to Javascript

        Because you shouldn't have to. The fact that === is included in the language as a cheap fix simply underlines how wrong it is.

    3. Anonymous Coward
      Anonymous Coward

      Re: Death to Javascript

      JavaScript is a dynamically-typed language.

      "0" == false is a natural consequence of dynamic typing. To avoid it you have to add complexity by making booleans a special case or reduce flexibility and eliminate them entirely.

      Dynamic typing is annoying, but with JavaScript being heavily built on associative arrays it makes the language very simple.

  6. Nuno
    Stop

    Dart runs 130 per cent faster

    "The goal is for Dart to become twice as fast."

    If I did the math right, are they trying to slow it down?

    Twice as fast is 100% faster...

    STOP, because they are going too fast!

    1. MayorBoris

      Re: Dart runs 130 per cent faster

      You beat me to it. I assume they mean it runs at 130% of the speed, ie 30% faster.

    2. diodesign (Written by Reg staff) Silver badge

      Re: Dart runs 130 per cent faster

      Point taken. It could be that Dart is running 130% faster but the target is twice that. Or it could be 30% faster but the target is 100%. We'll go back to the source to check this one.

      PS: On busy days thousands of comments are posted; we never get the chance to read them all so problems like this can go unnoticed. If you hit the corrections button on the article, we'll be able to fix problems immediately :-)

      C.

  7. Tom Chiverton 1
    WTF?

    In what way is ColdFusion in decline ? http://blogs.coldfusion.com/post.cfm/product-roadmap-for-coldfusion

    And don't get me started on what the Railo Foundation means for a FOSS implementation of the language, owned by JBoss : http://www.opencfmlfoundation.org/projects/railo/

    1. Steve Knox

      In This Way

      1. Netcraft hasn't even bothered mentioning them since 2003:

      http://news.netcraft.com/archives/2003/08/30/php_growing_surprisingly_strongly_on_windows.html

      2. According to w3techs "the" server-side scripting of the late 90s now powers just over 1% of dynamic sites:

      http://w3techs.com/technologies/overview/programming_language/all

      and

      3. That's in steady decline:

      http://w3techs.com/technologies/details/pl-coldfusion/all/all

  8. Hayden Clark
    Happy

    Phew!

    Curly-braces!

    syntax-significant whitespace always gives me the heebees......

    1. boltar
      Thumb Up

      Re: Phew!

      "syntax-significant whitespace always gives me the heebees......"

      Seconded. IMO its the one stupid design decision that stops python being a first class language. But unfortunately a language where accidentaly deleting a space or tab can change the whole flow of the code but remain syntatically correct has a major design flaw.

      eg:

      for i in xrange(1,10):

      ..func1()

      ..func2()

      vs

      for i in xrange(1,10):

      ..func1()

      func2()

      1. Ken Hagan Gold badge

        Re: Phew!

        In a perfect world, *all* programming languages would decouple their source syntax from their semantic elements. How hard could it be to write a front-end that accepted curly braces instead of significant white-space and then fed the resulting parse tree to *exactly the same* compiler? Probably "very", in real life. How hard *should* it be? Probably "trivial", since the formal tools for this were developed 50 years ago, by language designers.

        In fact, my new figure of merit for whether to take a new language seriously is "Does the default distribution come with multiple front ends to accomodate the various syntax prejudices of the programming community?". If not, I'm not interested. :)

        1. Anonymous Coward
          Anonymous Coward

          Re: Phew!

          I'm with you. In fact when I'm king, they'll be universal interpreters and universal compilers. If you're writing an interpreted programming language, it'll just be a wrapper and you'll hook it up to one of the universal interpreters using some standard protocol/api/whatever. The universal interpreter can hook into universal standard libraries SO THAT EVERY FUCKING LANGUAGE DOESN'T HAVE THE SAME CORE OBJECTS WITH SLIGHTY DIFFERENT METHOD NAMES/SYNTAXES.

          1. Eeep !
            Happy

            Re: Phew!

            Ha!

            That would be far too sensible for the world and might set a dangerous precedence of co-operation.

            Long live the new king, if it is Anonymous Coward :)

          2. csumpi
            Megaphone

            Re: Phew!

            Steve Ballmer! Welcome to the register. But next time, just use your real name, we know who you are ;)

          3. Anonymous Coward
            Anonymous Coward

            Not so much

            The problem with that is that it would come at a severe performance cost, hence why it's not done. Designing a language is much, much more difficult than using one. I'm assuming you didn't take Programming Languages in College? Because if you had, you'd realize that your point is absurd in real life, even if it does sound nice on paper.

            1. John H Woods

              Re: Not so much

              I agree with you, but this is less true with properly OO languages, where differences in syntax hide a much bigger underlying similarity in function. Look at Smalltalk - in one sense (class libraries) it is absolutely enormous but in another (syntax) it is minute - it doesn't case statements, if-then-else or loops.

              The only thing wrong with Smalltalk bytecode is that it was not secure, and that was, if I recall, one of the underlying principles of Java bytecode design (not that it worked completely). A standard bytecode into which a bunch of different OO languages could be safely compiled would be a wonderful thing.

          4. PeteA
            WTF?

            Re: Phew!

            You're going to re-invent C?

    2. david 12 Bronze badge

      Re: Phew!

      >Curly-braces!

      Curly braces always give me the heebeejeebees.

      I'm left handed, and a touch-typist from age 8. It was years before I relealized that one of the reasons I hate curly-brace languages is that those keys for which I use the Little Finger on my Right Hand, are actually the slowest and most difficult keys on the keyboard for me.

      And, of course, as a long-time touch typist, I'm not appalled at the effort of typing

      Begin End

      .OR.

      Balance equals Balance plus ItemCost

      (astute readers will have noticed that I put a decimal point on either side of that uppercase OR...)

    3. Anonymous Coward
      Anonymous Coward

      Re: Phew!

      Curly braces are just an alternative to terminators. They make sense in a brief language but not in a verbose one.

      I don't like the idea of syntax-significant indentation either, but I do like strict indentation.

  9. steven W. Scott
    WTF?

    All your web are belong to us

    "By borrowing from C++ and Java, the idea is Dart is familiar yet even easier and quicker to code in, and should generate fewer bugs – called side effects."

    *...eyeroll...*

    1. Ken Hagan Gold badge

      Re: ...eyeroll...

      Ditto.

      "side effects" is the term used by most language designers to refer to "evidence that your program is actually running". If a block of code has no side-effects, the optimiser is allowed to remove it. If two blocks have the same side effects, it is allowed to pick the cheapest one. Side effects are not equivalent to bugs unless your code is 100% bug.

      1. John D. Blair
        Paris Hilton

        Re: ...eyeroll...

        I have to quibble with this.

        Side-effects refer to effects a method or function has other than its return value. A common best practice is to eliminate all side effects b/c it makes the code a lot easier to test.

        Of course, at some point your code has to have side effects - it has to draw on the screen, or send packets, or whatever the point of the program is. However, the core of the program can still operate "without side effects."

    2. csumpi
      WTF?

      Re: All your web are belong to us

      "By borrowing from C++ and Java, the idea is Dart is familiar yet even easier and quicker to code in, and should generate fewer bugs – called side effects."

      Don't forget about the non nullable objects in Dart. A complete disaster. Just for that, Dart is DOA.

  10. Anonymous Coward
    Stop

    My Two Cents on A Browser Language

    * Don't use a VM. Compile stuff directly into machine code. All of it..

    * Allow for synchronous destructors and refcounted pointers.

    * Free yourself from the retareded ideas of Mr Gosling and the other academics. These will only generate bloat and crappy user experience.

    Basically, make it a memory-safe Delphi/TurboPascal variant. That will both compile extremely fast and the program will run very efficiently. No random freezing.

    1. Norman Hartnell
      Facepalm

      Re: My Two Cents on A Browser Language

      "* Free yourself from the retareded ideas"

      It's "retarded".

      1. Anonymous Coward
        Anonymous Coward

        Re: My Two Cents on A Browser Language

        Yeah. Typo. Any replies to my arguments, by chance ?

        1. Jean-Luc Silver badge
          Thumb Down

          Re: My Two Cents on A Browser Language

          Replies?

          A not-so-retarded academic designed Pascal, oh not-so-clever opinionated one.

          Personally, in an environment as malware-hostile as the internet, I rather like VMs and rather dislike the idea of machine code being generated and blindly trusted to execute safely. But that's just me.

          That's also the reason I rather like JS - the browsers do not trust it. Java on the other hand is handed over to a real VM which is trusted, with disastrous results. Raw speed is not always the most important thing and having a clear trust demarcation between real programs and web-based scripts is not a design flaw.

          1. Anonymous Coward
            Stop

            Re: My Two Cents on A Browser Language

            errm, we "need a VM", because bytecode has proven to be more secure than distributing source ??

            Java ans JS just proved the opposite. And, engineers at Borland made lightning-fast Pascal Compilers. The idea came from an academic, though.

            The truth is that the JVM (and probably also the current JS ebńgines) are extremely complex pieces of code. And they are laaarge. That creates a huge attack surface. Too big for Oracle to secure.

            I bet you could create a very secure and fast compiler for a memory-safe Pascal variant in less than 30K lines of C++ code. As opposed to millions of loc for the JVM and JS engines. The generated code would be highly efficient without much optimization.

            1. James 47

              lightning-fast Pascal Compilers

              Weren't they 'lightning fast' because you had to write your code so that it wouldn't require two passes of the compiler?

          2. Canecutter
            Pint

            Re: My Two Cents on A Browser Language

            "[H]aving a clear trust demarcation between real programs and web-based scripts is not a design flaw."

            Words to live by, except that I would expand that statement slightly to say having a clear trust demarcation between the _hosting system_ and the _application_ is not a design flaw.

            To thee I raise a pint!

    2. Deebster

      Re: My Two Cents on A Browser Language

      > Compile stuff directly into machine code

      Which instruction set?

      Or do you mean distribute the source and compile on-demand (which is pretty much what modern JavaScript engines do)?

      1. Anonymous Coward
        Anonymous Coward

        Re: My Two Cents on A Browser Language

        Exactly. Distribute Source Code and let the browser compile it into the local instruction set on the fly. Not "JIT", but "Turbo-Pascal Time" (so to speak).

        1. stanimir

          Re: My Two Cents on A Browser Language (Delphi/TP)

          What you describe is exactly JIT w/o recompilation (i.e. deoptimization/optimization cycles). FYI, GC is optional to JIT. GC however is a true blessing for any multithreaded code where detecting liveness is pain in the butt.

          Actually GC is a true blessing anytime.

          Read-barrier GC may make sense for fluid user experience (i.e. no freezes due to STW [stop the world] GC) but it's a hit in the benchmarks since each load has to be verified.

          Sophisticated techniques like Escape analysis (escape detection) to reduce the amount of object created would most likely not worth but w/ enough core it might be useful via tiered compilation.

          Good luck to Dart - strongly typed languages are much easier to reason in terms in corrects and static analysis.

    3. horse of a different color
      Mushroom

      Re: My Two Cents on A Browser Language

      It's sad that some developers think that the best way of improving performance is to 'compile stuff directly into machine code'.

      1. Anonymous Coward
        Anonymous Coward

        Re: My Two Cents on A Browser Language

        Why is it "sad" ? JIT just adds complexity for very little to no advantage. If you really need profiler data, that could be distributed in a different file alongside source to give the compiler optimization hints.

        Or the browser runtime could collect that profiling data and then do a recompilation of the source.

        Plus, distributing some sort of semi-opaque Bytecode only helps to obfuscate code for commercial purposes.

        1. horse of a different color
          Mushroom

          Re: My Two Cents on A Browser Language

          Whoops, must not feed the troll. My apologies everyone.

  11. Lallabalalla
    Stop

    "Just because Dart is Google's baby, that doesn't mean Dart is a shoo-in."

    Quite the opposite I'd have thought.

    It stands a chance of adoption because it's OO, fast, scalable etc DESPITE having anything to do with the data-snaffling privacy bashers.

    1. Anonymous Coward
      Stop

      Re: "Just because Dart is Google's baby, that doesn't mean Dart is a shoo-in."

      As the commercial arm of NSA, Google certainly hires only the best and brightest software engineers.

      Here's an alternative to Google and Bing: YACY. Run the crawler on you own PC.

    2. Anonymous Coward
      Flame

      Re: "Just because Dart is Google's baby, that doesn't mean Dart is a shoo-in."

      Strong typing and proper classes are actually a feature of any sane programming language. JS does not provide this. You never know what to really expect inside an object. You will have a hard time to make any assumptions on the correctnes of your code based on this lack of invariants.

      So, almost anything that is conventional and reasonable will be better than JS.

      The funny thing is that everybody thinks it will have to adhere to the Java-esque ideas of "needs VM", "everything will be a heap object", "we don't need synchronous destructors" and so on. I call this Intellectual Shallowness.

  12. Anonymous Dutch Coward
    Windows

    "the VM doesn’t have to take time running floating point connections to run new objects"

    Huh? I'm not that familiar with language internals let alone Javascript but... floating point connections to objects?

    Don't you mean (integer) pointers to new objects?

    I'd appreciate clarifications...

  13. Destroy All Monsters Silver badge
    WTF?

    "50 patents"

    1) Go to: USPTO search

    2) Query: in/Bak-Lars (where did they get that syntax?)

    3) ???

    "Method and apparatus for reducing memory usage by encoding two values in a single field"

    "Mixed execution stack and exception handling"

    "Method and apparatus for performing byte-code optimization during pauses"

    "Method and apparatus for concurrent thread synchronization"

    "Method and apparatus for implementing fast subclass and subtype checks"

    etc...

    Sigghhhh~

    1. Anonymous Coward
      Flame

      Re: "50 patents"

      Shertainly Google Would Never, Ever Do Evil, if anybody used their contraption and violated their patents.

  14. jxp

    What's the point

    Who (but Google) is going to support this?

    Does anyone fancy writing code for Chrome only, or are we expected to write systems twice (once in js, once in Dart)?

    We're just getting rid of the last bone-headed round of browser lock-in (IE6 I'm looking at you).

    Let's not start that again.

    Still at least its better than Google's Salt idiocy (and how is Google Go doing?)

    1. Anonymous Coward
      Flame

      Re: What's the point

      The point is that JS is a real dog of a language. You know, as in "German Dackel", not as in "German Sheperd Dog".

      http://www.vondersingoldau.de/images/dsc01245480_480.jpg

      1. Destroy All Monsters Silver badge

        Re: What's the point

        Longdog is long!

      2. csumpi
        Mushroom

        Re: What's the point

        "The point is that JS is a real dog of a language. "

        So is Dart at this point. Just try it. Or if you don't have time for that, just Google "dart non nullable objects" and enjoy the cursing on Google Groups.

  15. tekHedd
    Meh

    Hold me back.

    I believe I speak for the majority of professional programmers on the planet when I say, with sarcasm, "oh goody, another programming language."

  16. Tom 7 Silver badge

    The trouble with programming languages

    is that if you cant be arsed to learn the ones available you've got properly you can always write another one.

    The real trick is to get involved in ECMA or ISO to make sure that someone else's language doesn't achieve nirvana before yours gets ignored.

    We are continually reinventing the wheel using shit graphics programs running on the spare CPU cycles on our matter transporter while people argue over what colour wheels the matter transporter should have.

    1. Oninoshiko
      Stop

      Re: The trouble with programming languages

      I would put some credence in this, except that google and THIS MAN have done the most to advance ECMA of anyone in the last decade.

  17. Anonymous Coward
    Headmaster

    Catch 22

    The thing with Google is that they have a bit of a lot of 'previous', when it comes to announcing "The Next Big Thing" only to abandon it again, a few months or years down the line. Not such a problem when "The Next Big Thing" is something fairly trivial like Wave, but when "The Next Big Thing" is something as fundamental as a replacement for JS, I'd be pretty surprised if there's much of a stampede of folks willing to invest the man-hours in learning it, before it's gained traction.

    And it won't gain traction without a stampede of folks willing to invest the man-hours in learning it.

    1. asdf Silver badge

      Re: Catch 22

      >The thing with Google is that they have a bit of a lot of 'previous', when it comes to announcing "The Next Big Thing" only to abandon it again, a few months or years down the line.

      You could interchange Microsoft with Google in this statement (see Silverlight, WPF, and soon to be TIFKAM)

    2. tuxtester

      Re: Catch 22

      With JavaScript I reckon there are two concepts the programmer has to understand:

      - The various Document Object Models.

      - JavaScript syntax.

      Plus the fact you can insert JavaScript (seemingly) anywhere on a web page.

      I would like a bunch of getters and setters for DOM elements and Dart offers this.

      1. Michael Wojcik Silver badge

        Re: Catch 22

        With JavaScript I reckon there are two concepts the programmer has to understand:

        - The various Document Object Models.

        - JavaScript syntax.

        And a few other things, one might hope, such as the HTML and CSS standards, Javascript[1] semantics, good UI/UX/UIM practices, etc.

        I would like a bunch of getters and setters for DOM elements and Dart offers this.

        As do a zillion ECMAScript frameworks and libraries. True, the vast majority of them are horrible code written by people who can't be bothered to understand the language (hello, JQuery), but there are a few decent ones, and it's hardly difficult to write your own, if you have actually learned the subjects listed above.

        And why is it useful to free developers from having to learn about the DOM? Do we really need more software written by people who don't understand what they're doing?

        [1] Actually ECMAScript, which is the name of the language. "Javascript" is the proprietary, non-standard ancestor of ECMAScript, or the name of one ECMAScript implementation. The camel-case "JavaScript" is a typographic error or barbarism.

        1. Anonymous Coward
          Anonymous Coward

          "... who can't be bothered to understand the language (hello, JQuery)"

          I'm only just learning Java[Ss]cript and was looking forward to learning JQuery which I thought everyone loved. What's wrong with it?

  18. Charlie Clark Silver badge

    Twice as fast?

    Speed obviously isn't the selling point for this: twice as fast means about one generation of mobile phones and that in a small part of user experience. Offloading stuff to hardware via, say WebGL or CSS, brings a lot more. It's far from perfect but the slow and steady development and adoption of HTML 5 (including CSS and JS) is gradually moving things along.

    1. Michael Wojcik Silver badge

      Re: Twice as fast?

      And, of course, if you speed up the execution environment, application developers will just add more bloat to compensate. There's an optimal area in the UI-crap-vs-user-impatience curve, and most apps will follow that gradient.

  19. Nathan 6
    IT Angle

    Dart -- Great in theory, but doomed to fail?

    After keeping up with Dart progress for the better part of it's lifespan, I can see why hard core developers would like the concepts it bringing to the table for web developement. However, aside from the performance gains, most of what dart would deliver can already be done with existing stuff. For example, for structured development GWT/GXT presents a much better option since all the knowledge, tools, middleware etc ... are already entrenched.For more basic needs, there are enough JS frameworks and planned language additions to fit most people needs.

    So the question remains, is there enough developers from those 2 camps who will by into Dart?

    1. tuxtester
      Meh

      Re: Dart -- Great in theory, but doomed to fail?

      I'm a Java and Android developer but I want to get into HTML 5 development because Mozilla OS for mobiles sounds really interesting. However JavaScript is chaotic compared to Java.

      With Dart, the idea of writing a single program in an object-oriented language that is referenced by a web page, just sounds really appealing.

      And the learning curve, with regards to the syntax seems straight forward.

      I reckon there are a lot of Java and C++ programmers out there who feel the same.

      P.S.

      There's the likelihood that Dart will be supported by Android and suddenly 75%+ mobile devices around the world are compatible with it.

  20. Jonathan 27 Bronze badge

    Meh

    Dart's problem is that there really is no advantage to using it over Javascript and it's not supported by ANY current browsers. Google can't just force everyone else to support a new programming system, this should have all gone through a standards body. That way we could be seeing support in all major browsers.

    As is, I'm not going to use it in any production projects. It's just a toy at this point unless it gets picked up by other browser vendors.

    P.S. Python whitespace is it's biggest issue, but not it's only. I've seen it used for everything from web apps to full graphical client apps and I think it's biggest issue is that people use it for things it was never designed for. If you're doing a web app, a system designed for web apps is the way to go and for complex client apps python's performance is just too poor.

  21. Jason Terando
    Coat

    Untie the Gordian Knot

    One of the things that make Javascript weird, especially for newbies, is that the DOM manipulation (getting and tweaking HTML and CSS information) and browser events appear inexorably tied in with the language semantics - they really aren't, but the only real gateway to the DOM is via Javascript (unless you are writing browser-specific add-on's).

    To be a bit Pollyannaish, maybe the browser manufacturers could agree upon an interface implementation that just was about DOM access, manipulation and event notification; and leave the language semantics and constructs at the "plug-in" level, triggered by script tagging. If you want to implement PERL or PASCAL for the browser, go for it. Grammar, punctuation, white space handling, collections, variable naming, whatever, the browser should not worry about it.

    When the browser comes across a type attribute in a script tag it hasn't encountered before, the browser can prompt the user to download or find an appropriate plug-in. Embedded scripts would have to play nice with HTML syntax and grammar, but external scripts can use whatever markup they want.

    Security? Well, scripting languages can't do anything with the underlying system that the browser doesn't allow (i.e. no unlimited file system or device access), same as today. Browser manufacturers would have to do some work to make sure that the sandbox scripting engines would play in would be sufficiently isolated from the file system, heap, etc.) . This approach may be somewhat in line with the "browser is the OS" meme that Google pushes, but in any sophisticated website, the browser really is acting like a very limited OS. I don't have a problem with that as long as the limits are well defined, understood and complied with (no nasty ActiveX-like shenanigans please).

    Mine's the one looking for his "Python for Web Pages" O'Reilly book...

  22. tuxtester

    Forget the desktop, Android is the major influence.

    Google have the power to make Dart an important web technology just by implementing it in Android.

    The desktop computer is circling the drain. HTML 5 apps on mobile devices will become more important, especially with the release of Mozilla OS.

    If Android integrates a Dart VM then I reckon Mozilla will have to offer it on their mobile OS.

  23. Paul Hovnanian Silver badge

    Re: ...eyeroll...

    Side effects are why we write code. If not for them, execution of a program would have no observable effect in the outside world. On the other hand, side effects don't tell you all there to know is about the internal state of an object. So debugging (or optimizing) based upon side effects alone is incomplete.

  24. Anonymous Coward
    Anonymous Coward

    Obligatory XKCD

    http://xkcd.com/927/

    Was intended more for standards, but applies perfectly to languages.

    The world does not need another Javascript.

  25. Christian Berger Silver badge

    So... it compiles to some VM byte code???

    Ignoring the fact that a "byte code" is barely platform independent because not every platform has 8 bit bytes,... wouldn't that mean that you don't get the source code?

  26. grammarpolice
    FAIL

    Dart

    From the Dart documentation:

    Here’s another example of code that behaves differently in JavaScript and Dart:

    if (1) {

    print('JavaScript prints this line because it thinks 1 is true.');

    } else {

    print('Dart in production mode prints this line.');

    // However, in checked mode, if (1) throws an exception

    // because 1 is not boolean.

    }

    Dart has got to be the only language going that thinks that 1 is not true. Every single time someone invents a new language, they always manage to fuck it up by doing something different and unexpected, resulting in years of errors and frustration by developers. The choice is arbitrary - make it do it the same way as everything else and people will understand it. Do it differently for no reason, and nobody will buy into your spangly new language.

This topic is closed for new posts.

Biting the hand that feeds IT © 1998–2019