What it does?
PNACL compiles the source code (c, c++ code) to .nexe (for native client ) and .pexe (for portable native client) bitcode executables, which inturn can be used to run on browsers (translates the bit code to a host-specific executable as soon as the module loads in the browser but before any code execution).
input -> sourceCode -> makefile -> .pexe/.nexe file ->output
and, embed .pexe/nexe file along with native client's manifest file(which tells type of file), we can run this on browser.
What is it used for?
Small legacy applications and games, which are C, C++, Java, Python etc.,. coded and need to run as browser apps.
Why cannot node be used to create pexe / nexe?
Node is huge(more than 1000 files). If we are using node source code in native client, which means we are recreating node. I am sure it is relatively huge task by looking at the files and how it is structured. It is combination of C and C++ main source files, and also includes JS libraries. Need a through knowledge of how node is developed.
Challeges can be faced
1) Node does not run on browser. it is intended to work on server side. Converting node to .pexe/.nexe and running as browser app seems impractical.
2) node has node package manager(npm). How could we use .pexe/.nexe to install node packages?
3) Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Could we reinvent all these?