Slashdot Mirror


VM-Neutral Node.js API Unveiled, As NodeSource Collaborates With Microsoft, Mozilla, Intel and IBM (medium.com)

An anonymous reader writes: This week saw the first proof of concept for Node.js API (or NAPI for short), "making module maintainers' lives easier by defining a stable module API that is independent from changes in [Google's JavaScript engine] V8 and allowing modules to run against newer versions of Node.js without recompilation." Their announcement cites both the efforts of the Node.js API working group and of ChakraCore, the core part of the Chakra Javascript engine that powers Microsoft Edge.

And there was also a second announcement -- that the Node.js build system "will start producing nightly node-chakracore builds, enabling Node.js to be used with the ChakraCore JavaScript engine. "These initial efforts are stepping stones to make Node.js VM-neutral, which would allow more opportunities for Node.js in IoT and mobile use cases as well as a variety of different systems."

One IBM runtime developer called it "a concrete step toward the strategic end goal of VM neutrality," and the Node.js Foundation believes that the API will ultimately result in "more modules to choose from, and more stability with modules without the need to continually upgrade."

28 comments

  1. Step 1: take famous API name, like NPAPI by Anonymous Coward · · Score: 0

    Step 2: remove a letter
    ??
    Profit!!

    1. Re:Step 1: take famous API name, like NPAPI by __aaclcg7560 · · Score: 1

      Or create an app with the same name of an obscure library file, get the repository to remove the library file, piss off the author of the library file, and break the Internet at the same time.

      http://arstechnica.com/information-technology/2016/03/rage-quit-coder-unpublished-17-lines-of-javascript-and-broke-the-internet//

  2. Amazing progress for JavaScript by Sla$hPot · · Score: 1

    Great times for web developers. With support for Jxcore, spidermonkey Chakra incl. Webassembly, Emscripten, nodejs will become a true multiplatform contender.

    1. Re:Amazing progress for JavaScript by Anonymous Coward · · Score: 0

      You're welcome.

      -- Donald Trump

    2. Re:Amazing progress for JavaScript by __aaclcg7560 · · Score: 1

      That's crony capitalism!

      -- Sarah Palin

  3. But WTF is it? by Anonymous Coward · · Score: 0

    I keep hearing about this node.js thing but nobody has ever been able to clearly explain it to me: what the hell is it? Is that like that jQuery crap?

    1. Re:But WTF is it? by manu144x · · Score: 1, Funny

      If you don't get it by now, it's probably too late anyway.

    2. Re:But WTF is it? by Lisandro · · Score: 2

      Is an async framework for Javascript which somehow become hugely popular and people use to write web servers. Yes. In Javascript.

    3. Re: But WTF is it? by Anonymous Coward · · Score: 1

      Server side JavaScript. Mostly you have access to the file system.

      They originally ripped out v8 from Chrome. So you could run JS code without a browser and get access to the file system (and other various OS components not typically available in a JS sandbox).

      jQuery was just a set of functions standardized to work in all browsers back when that was actually a chore.

    4. Re:But WTF is it? by Anonymous Coward · · Score: 0

      I keep hearing about this node.js thing but nobody has ever been able to clearly explain it to me: what the hell is it? Is that like that jQuery crap?

      More like Apache+PHP... But overall yeah, same level of useless crap as jQuery, for anyone who values the web as a simple, semi-efficient and diverse hypertext medium.

    5. Re: But WTF is it? by Anonymous Coward · · Score: 3, Informative

      It's not an async framework, it's a VM which happens to execute things asynchronously (and is mostly built on top of libuv).

    6. Re:But WTF is it? by Hognoxious · · Score: 2

      It's too late in any case. By the time you've learned it it's either been replaced by something else (potentially an incompatible version of itself) or been abandoned.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    7. Re: But WTF is it? by Anonymous Coward · · Score: 0

      It kinda is both. Some genius thought it was a good idea to hack V8 and bundle it with the framework.

    8. Re:But WTF is it? by Anonymous Coward · · Score: 1

      You don't want to know. I sure know I was happier before I had to learn and use this sh*t.

    9. Re: But WTF is it? by Luthair · · Score: 1

      More friendly API on jQuery too

    10. Re: But WTF is it? by Anonymous Coward · · Score: 0

      JQuery was an absolute godsend back when each browser did things differently. You could test code on one browser and be 99% confident it would work the same in all the others. And just when you think you don't need it anymore, along comes MS Edge, which I still don't have a test system for because it only installs on windows 10.

    11. Re:But WTF is it? by Anonymous Coward · · Score: 1

      I keep hearing about this node.js thing but nobody has ever been able to clearly explain it to me: what the hell is it? Is that like that jQuery crap?

      Your attitude may contribute to fewer people being willing to spend any time on explaining things to you. Use Google and find out yourself. Stop being lazy.

  4. Your are kidding, right? by Anonymous Coward · · Score: 0

    Who on earth would choose Javascript for server-side code?

    1. Re:Your are kidding, right? by Lisandro · · Score: 2

      Hey, when the only tool you know is a hammer...

    2. Re:Your are kidding, right? by Anonymous Coward · · Score: 0

      Who on earth would choose Javascript for server-side code?

      I have wondered the same thing... I still don't get it. Maybe it just reduces time to market on a quick API or something.... I'm still trying to figure out why you would choose this over anything else on the server

    3. Re:Your are kidding, right? by narcc · · Score: 2

      PayPal, NetFlix, Medium, LinkedIn, Uber ... Quite a few, as it turns out.

    4. Re:Your are kidding, right? by Anonymous Coward · · Score: 0

      The theory is that web devs only have to learn one language if everything is JavaScript.

      It's unfortunate that JavaScript is such a terrible language. Almost anything else would have been better. I'd be keen on Haskell or Clojure, for instance.

    5. Re:Your are kidding, right? by Luthair · · Score: 1

      Its the same people who used to use Ruby basically. Squirrel!

    6. Re:Your are kidding, right? by Lussarn · · Score: 1

      Who on earth would choose Javascript for server-side code?

      It's not only serverside either, it's now possible to make fullblown desktop applications using mostly javascript/HTML/CSS with Atom. Atom basicaly is chromium + node.

      http://electron.atom.io/

      It's picking up pace and the programs written in this feels modern, like the web. It's extremely flexible compared to any existing widget toolset out there. And the applications written are fast. I''ve used it for quite a large project and to me this is what Java promised 20 years ago regarding write once/run everywhere, pixel perfect. I will probably never use a native toolset for a larger project again, too much hassle compared to some HTML/CSS/Javascript. V8 is fast enough for most code and performance code or platform specific features can be written in a compiled language. Mutliplatform is not free but very close.

  5. nbind is an existing VM-neutral API by Anonymous Coward · · Score: 1

    nbind is a VM-neutral stable C++ / JavaScript API that already works across all versions of Node.js, Electron and recent evergreen web browsers. Binaries for Node.js and Electron can be compiled using GCC, Clang or Visual Studio targeting Linux, OS X or Windows. Asm.js binaries for browsers and Electron can be compiled using Emscripten. The API is the same in both cases, and work is ongoing to also provide a stable ABI across all versions of Node.js and Electron on a single platform.

    Basically C++ classes and functions can be written using ordinary standard library types. Calling a special macro then invokes templates from nbind headers that autodetect argument and return types, handle type conversion and inform the JavaScript VM about the C++ API. nbind can also automatically generate TypeScript definitions.

    Here's an example:


    class VectorTest {
    public:

        static std::vector getInts() {
            std::vector a {{ 13, 21, 34 }};
            return(a);
        }
    };

    NBIND_CLASS(VectorTest) {
        method(getInts);
    }

    To call it from Node.js:


    const addon = require('nbind').init().lib

    console.log(addon.VectorTest.getInts());

  6. Oh darn ... by Anonymous Coward · · Score: 0

    The summary destroyed my hope that with IBM involved "VM-Neutral" might include VM/CMS...

  7. "ChakraCore, the core part of the Chakra" by Anonymous Coward · · Score: 0

    Oh, really?

  8. Beware by Anonymous Coward · · Score: 0

    Beware Romulans baring gifts.