node.native is a C++11 (aka C++0x) port for node.js.
Please note that node.native project is under heavy development: currently experimental.
Simple echo server:
#include "native.h"
using namespace native;
int main(int argc, char** argv) {
return run([=]() {
net::createServer([](net::Server* server){
server->on<ev::connection>([](net::Socket* socket){
socket->pipe(socket, {});
});
server->on<ev::error>([=](Exception e){
server->close();
});
server->listen(1337, "127.0.0.1");
});
});
}
To compile native.a and sample apps:
make
I tested the code on Ubuntu 11.10 and GCC 4.6.1.
You can also access this page via http://www.nodenative.com.