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."
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."
Great times for web developers. With support for Jxcore, spidermonkey Chakra incl. Webassembly, Emscripten, nodejs will become a true multiplatform contender.
If you don't get it by now, it's probably too late anyway.
Is an async framework for Javascript which somehow become hugely popular and people use to write web servers. Yes. In Javascript.
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.
It's not an async framework, it's a VM which happens to execute things asynchronously (and is mostly built on top of libuv).
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."
Hey, when the only tool you know is a hammer...
You don't want to know. I sure know I was happier before I had to learn and use this sh*t.
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());
PayPal, NetFlix, Medium, LinkedIn, Uber ... Quite a few, as it turns out.
Required reading for internet skeptics
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//
Its the same people who used to use Ruby basically. Squirrel!
More friendly API on jQuery too
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.
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.