back to article JavaScript creator Eich's latest project: KILL JAVASCRIPT

Brendan Eich, the former CEO of Mozilla, has announced a new project that could not only speed up web applications but could eventually see the end of JavaScript as the lingua franca of web development. Dubbed WebAssembly, the new effort is a kind of successor to Asm.js, the stripped-down JavaScript dialect that backers …

Page:

  1. Phil O'Sophical Silver badge
    Coat

    And so the wheel turns

    Any day now they'll reinvent UCSD P-Code...

    1. John H Woods Silver badge

      Re: And so the wheel turns

      Indeed ... as a lifelong Smalltalk afficionado I find many modern programming language developments very pleasing ...

    2. Stuart 22

      Re: And so the wheel turns

      < Dusts down his Fortran IV subroutine libraries and unstructured GOTOs >

    3. Mage Silver badge
      Facepalm

      Re: And so the wheel turns

      Actually JVM, MS pre .net VB runtime and .Net engine are all derived from the p-code Machine.

      1. joeldillon

        Re: And so the wheel turns

        Um in the sense they use the same ideas, sure. They don't descend from its codebase or use its format.

        1. Anonymous Coward
          Holmes

          Re: And so the wheel turns

          The wheel is not so much turning as being re-invented.

    4. Anonymous Coward
      Anonymous Coward

      Re: And so the wheel turns

      Java very similar to the Pascal it is based upon.

      1. Michael Wojcik Silver badge

        Re: And so the wheel turns

        Java very similar to the Pascal it is based upon.

        For very small values of "very", I suppose.

        The Java language is not close to Pascal at all, in terms of its syntax - aside from the similarities common to all the ALGOL-influenced imperative languages - or paradigms, since Java is an OO language and Pascal is not.

        As for implementations, while the UCSD p-System Pascal did compile to a bytecode that was later interpreted by a VM, it's hardly "very similar" to Java. Certainly it was an influence, as was the Smalltalk VM, but many variations on compiling to intermediate forms that were then interpreted had been around for decades when Gosling invented Java. Besides p-System and Smalltalk, there were various tokenizing BASIC interpreters and Micro Focus' "int" format for COBOL programs, for example.

  2. dogged

    I bet MS will be pushing for a C#->WebAssembly compiler. Or maybe F#.

    (Not that I think this would be a terrible thing but without the surrounding assemblies it's hard to know how useful C# would be).

    1. Tim Almond

      Typescript

      MS are pushing more for Typescript at the moment, which compiles down to JS.

      1. dogged

        Re: Typescript

        yes, but the idea of everything compiling to wasm (that's what they're calling it, apparently), there is no need to have something compile to JavaScript.

        "wasm". Sounds weird. I recommend they change to "Web Assembly System Code" and then we can pronounce it "wazzock".

  3. Anonymous Coward
    Anonymous Coward

    That picture...

    ... makes him look like he's smelt something unpleasent. Probably the javascript section of the latest HTML5 spec.

    "kind of binary object format for the web, one that can be used as a compiler target for all kinds of languages"

    Err, we've had that for years. Its called Java bytecode. Oddly craplets didn't prove too popular.

    1. Anonymous Coward
      Anonymous Coward

      Re: That picture...

      ...nearly made me punch my monitor.

      Eich!

    2. Extra spicey vindaloo

      Re: That picture...

      Silverlight didn't last much longer either,

      Flash is finally dying.

      If they put their minds to it I think they would be able to produce a round circular contraption that could be used as an interface between the ground and a moving object being pulled along by some means of locomotion.

      1. Anonymous Coward
        Anonymous Coward

        Re: That picture...

        "If they put their minds to it I think they would be able to produce a round circular contraption that could be used as an interface between the ground and a moving object being pulled along by some means of locomotion."

        Except it would probably be triangular and fashioned from mud, bits of twig and titanium.

        1. Andy 73 Silver badge

          Re: That picture...

          Ha, If you're so clever, YOU tell us what colour it should be.

  4. This post has been deleted by its author

  5. spot

    Source?

    "the specification will include a text format" - I bet the binary will still run even if the source isn't provided, though.

    1. mythicalduck
      Mushroom

      Re: Source?

      Oh, source will be provided - but maybe not the same source code that was used to build the binary

      1. Ken Hagan Gold badge

        Re: Source?

        Source, in the same way that I can already use a disassembler to produce "the source code" for Windows 10.

        1. Michael Wojcik Silver badge

          Re: Source?

          Source, in the same way that I can already use a disassembler to produce "the source code" for Windows 10.

          I see the problem. Take a look at line 1287892832, and then line 19984904.

  6. DrXym

    JS is the problem in the first place

    What's really needed is to be able to run the LLVM bitcode directly in a page with some APIs that allow it to interact with the DOM, input, rendering and so forth. How the browser executes the bitcode is entirely up to itself - it could even emit JS bytecode if it wanted in-memory (much like Emscripten turns bitcode into asm.js code but without the need to parse it), Or it could do something more sophisticated such as compile it into native assembly code (suitably seeded with stack guards, hooks and so on).

    Google's Chrome more or less has this already in PNaCl which is LLVM hooked up to a Pepper API which does the outward bindings. What should really happen is that other browsers adopt PNaCl or use it as the basis of a cross-platform specification which does something similar.

    1. Anonymous Coward
      Coat

      Re: JS is the problem in the first place

      While we're at it, let's dump ALL the Bad Parts (tm): DOM, HTML, XML, CSS... until all that's left are LLVM and some cross-platform 'native' APIs. Cross-platform apps! Wait, this sounds familiar *cough* Java *cough* ... but can we learn from those mistakes? Nah...

      I was hopeful about JS and HTML5 a few years ago but it's not working out. On to plan C...

      1. Anonymous Coward
        Mushroom

        Re: JS is the problem in the first place

        The never ending switches to something old, something new something {Big Red, Chocolate Factory, Big Blue, ...} is getting, no beyond that, f---ing to the point of rendering me homicidal!

        Yup, all those promises about fucking code reuse? How does that work when you keep changing the code! <mumble, grumble, lock & load>

      2. mythicalduck

        Re: JS is the problem in the first place

        I was hopeful about JS and HTML5 a few years ago but it's not working out. On to plain C..

        FTFY, though consider C++ too ;)

  7. Anonymous Blowhard

    "Someday you'll code for the web in any language"

    Does that include Welsh?

    1. Anonymous Coward
      Anonymous Coward

      Does that include Welsh?

      Of course. Even better: you can do that already in JavaScript by adding

      # boyo!

      to the end of every line.

      1. xeroks
        Coat

        Re: Does that include Welsh?

        would that make it WelshAssembly?

      2. lambda_beta
        Linux

        Re: Does that include Welsh?

        My vote is pig latin. It will probably have as many bugs as any other language and has the advantage of built-in encryption (for a little while).

      3. DasWezel

        Re: Does that include Welsh?

        Nah, you'll know it supports Welsh when true/false functions return "Da iawn bach".

        Then you're tidy.

  8. Mine's a pint

    Aren't standards wonderful

    Obligatory XKCD reference

    https://xkcd.com/927/

  9. This post has been deleted by its author

    1. dogged

      well, they kind of are, if you extend the metaphor so that your browser becomes a VM or container in its own right because they are a mid-point for addressing the "CPU" of the vm/container/browser.

      I understand your pedantry on the matter (hence upvote) and find it tempting myself but it we have to admit that it is either pedantry or a failure to think in terms of abstract entities rather than physical transistors.

    2. Anonymous Coward
      Anonymous Coward

      So I read Eich's actual blog... he freely admits it's become a cliche that JS is web assembly. This is actually a binary AST format for Asm.js, to cut the client's parsing overhead.

      I share your scepticism, 1980s_coder. To paraphrase a line from yesterday's Elon Musk article, it's a shame that all these language designers are fiddling with the web instead of just designing a better language.

      1. Michael Wojcik Silver badge

        it's a shame that all these language designers are fiddling with the web instead of just designing a better language

        There are hundreds of language designers out there designing (purportedly) better languages. Most of those languages are never used for real work. Improving the state of web-application development is much more complicated than simply "designing a better language".

        And since there will never be agreement on what that "better language" should look like, providing a common runtime for multiple languages - whether it's Asm.js or WebAssembly or something else - that will actually be available on a decent subset of browsers seems rather more productive.

  10. JHC_97

    Oh if only there was already a language out there which compiled to byte code and could be used cross platform.

    1. no-one in particular

      > Oh if only there was already a language out there which compiled to byte code and could be used cross platform.

      BCPL Cintcode?

  11. Filippo Silver badge

    solving the wrong problems

    I'm looking forward to the day when the latest WebAssembly version will be 4.0, but 85% of browsers only support up to 3.0, 40% only support up to 2.0, 10% support only 1.0, 35% have dropped support for anything below 3.0 due to security issues, and the boss wants me to use a library that only works reliably on versions 2.0 or 3.0 because 4.0 has changed an opcode. Meanwhile, telling a div to occupy all remaining screen space will still require hours of swearing.

    Seriously, the JS syntax is frequently annoying, but it's really not the major problem with the web, not by a long shot.

  12. Charlie Clark Silver badge

    Been a while in coming

    At last year's PyCon Gary Bernhardt gave an entertaining and informative talk on this kind of thing called The Birth and Death of Javascript. Basically, the combination of LLVM and modern hardware (lots of memory required) allow compiling from one language to another in near real-time.

    Javascript was thrown together in a matter of days and has struggles with all kinds of things which could not really have been thought of at the time (yes, I know proper languages had already solved most of the problems correctly) considering its extremely limited domain. Personally, I hate trying to write anything in it but the web has made it ubiquitous. Hence, the desire to find reasonable solutions to the limitations without creating new, incompatible runtimes. Be interesting to see where this goes but I think it's got legs.

  13. Kubla Cant

    Kill JavaScript?

    I don't think the availability of other languages for the browser will kill JavaScript now. Five years ago, maybe, but today most of its peculiarities have been turned into strengths.

    It's very odd. JavaScript spent the first half of its life as the idiot cousin of the family of block-structured procedural languages. Then, apparently without significant change to the language, developers started to bend and twist it to the extent that modern JavaScript looks very different, and can do some remarkable things.

    Personally I still find working in JavaScript makes me feel like I'm going round Hyde Park Corner on a bicycle, and it's exasperating the way every month brings a new best-ever framework or library. But these days it doesn't owe its continued existence to the fact that it's the only thing that runs in the browser.

    1. Neil Stansbury

      Re: Kill JavaScript?

      JavaScript itself has never really been the problem - not since ES3 at least.

      The real problem is that most "programmers" have never understood that the craftsman maketh the tool - not the other way around.

      If you think there is such a thing as "async hell", or that the new hip flavour-of-the-month framework will save you from such-and-such then your problems aren't in JS or ASM or bytecode....

      JS code can and should be beautiful, expressive and elegant, but it will happily offer you enough rope to hang yourself. Sure it might be different rope to that of C, but nonetheless it will gladly hand you the rope if you ask for it.

      Snobbery and jealousy have long played a part in the JS world, after all - we all know it's not a "real language" don't we?

      AS3, Dart, Coffee, Typescript are all borne of people desperately trying to pretend that they don't really write JavaScript - they write in a "proper" programming language.

      The thing is despite its flaws - it's succeeded spectacularly where everything else has failed.

      The Java community especially, have never got over the fact, that the bastard little runt that was to provide some petty hooks for their web ambitions, ended up delivering the write-once-run-anywhere dream that their blue-eyed boy never could.

      Brendan Eich said it best: "Again we see how the Web favors a succession of “little bangs”

      Always bet on JS

      1. ecofeco Silver badge

        Re: Kill JavaScript?

        Interesting take on it, Neil. Upvoted.

      2. dajames

        Re: Kill JavaScript?

        JS code can and should be beautiful, expressive and elegant, but it will happily offer you enough rope to hang yourself. Sure it might be different rope to that of C, but nonetheless it will gladly hand you the rope if you ask for it.

        That, surely, is why JavaScript IS the problem (or part of it, anyway).

        A safer language would be beautiful, expressive, and elegant without going around handing out unwanted ropes to all an sundry. Given that half the programmers in the world are of no better than average ability (for some definition of average) we should surely strive to ensure that they use only languages that keep their ropes to themselves.

        Snobbery and jealousy have long played a part in the JS world, after all - we all know it's not a "real language" don't we?

        Snobbery and jealousy have nothing to do with it. JS is a language that is easy to use badly and difficult to use well.

        They say that a bad workman blames his tools -- but the truth is that a good workman knows to choose good tools, and to care well for them. In this case JS is the only tool available, and while a good workman might prefer to avoid it he has little choice. It is a tragedy that such an unsafe tool has become the de facto language for web programming.

  14. Anonymous Coward
    Anonymous Coward

    Replacing readable code makes you more secure?

    Perhaps they need to rethink this.

    1. Anonymous Coward
      Anonymous Coward

      Re: Replacing readable code makes you more secure?

      Quaint. If only you could convince all the devs to stop using minify/uglify...

  15. Christian Berger

    Probably one of the worst things that could happen to the web

    Suddenly you wouldn't be able to simply patch buggy Javascript any more, you'd have to mess around with some opaque binary files.

    It will make the web even less free and less reliable and it'll introduce whole new classes of vulnerabilities. Suddenly web apps will have buffer overruns, so one part of a web app will be able to overwrite code from another one by accident. Combine that with the typical idiocy of your mediocre web developer and you've got a recipe for disaster.

    Web apps already have Javascript which is way fast enough for everything you should do with it. For the rest you have video tags and other cool stuff.

    1. Stevie

      Re: Probably one of the worst things that could happen to the web

      My thoughts exactly.

    2. Rob Gr

      Re: Probably one of the worst things that could happen to the web

      Its a virtual machine being designed for the web, how the hell do you think it will introduce buffer overruns. Do you really think Google, MS and Mozilla aren't aware of the need for security?

      Technologies like asm.js are much, much worse - the load times are simply prohibitive for anything beyond a simple demo. If the web is too evolve, something like this is badly needed.

  16. Torben Mogensen

    Clean slate

    IMO, the idea of a low-level language supported efficiently by all browsers is a great idea. But it should be designed from a clean slate instead of being based on Javascript. That would allow such things as verifiable code (that carries proof hints to speed up verification), vector parallelism that can be executed on the graphics processor, and several more things that the baggage of Javascript hinders. Also, Asm.js does not (as far as I know) support garbage collection, so every language needs to roll its own. Since nearly every high-level language these days uses GC, this ought to be standard on a virtual machine.

    1. Rob Gr

      Re: Clean slate

      Its actually being based on asm.js, not javascript. This an entirely different beast.

Page:

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like