The DOOM of Async Frameworks: Write Once, Build Everywhere, Process Everything.
Nodepp is a groundbreaking C++ framework that bridges the gap between the language's raw performance and the developer-friendly abstractions of Node.js. By providing a high-level, asynchronous API, Nodepp empowers you to write C++ with a familiar syntaxβenabling seamless development across cloud servers, desktop apps, and microcontrollers.
At its core, Nodepp features a 100% asynchronous architecture powered by an internal Event Loop. This allows for massive concurrency and scalable task management with minimal code complexity, effectively bringing the "Write Once, Run Everywhere" philosophy to the world of high-performance C++.
π: Nodepp The MOST Powerful Framework for Asynchronous Programming in C++
To showcase Nodepp for Web, we ported the classic Duck Hunt to Virtual Reality, running natively in the browser via WebAssembly. This project pushes the limits of web-based VR by combining low-level C++ performance with modern Web APIs.
ezgif-7a54260198ce48cc.mp4
Play it now: Duck Hunt VR on Itch.io
Cursed-Luna is a high-performance remake of the Global Game Jam 2018 classic. Originally built around the theme of Transmission, this version has been completely rewritten in C++ using Nodepp and Raylib to bring tight gameplay mechanics to the browser via WebAssembly.
ezgif-7b0a4670cfd24b91.mp4
Play it now: Cursed-Luna on Itch.io
#emscripten
πͺ: pacman -S mingw-w64-ucrt-x86_64-emscripten
π§: sudo apt install emscripteninclude(FetchContent)
FetchContent_Declare(
nodepp
GIT_REPOSITORY https://github.com/NodeppOfficial/nodepp-wasm
GIT_TAG origin/main
GIT_PROGRESS ON
)
FetchContent_MakeAvailable(nodepp)
#[...]
target_link_libraries( #[...]
PUBLIC nodepp #[...]
)- π: Lightweight: Minimal dependencies, making it ideal for IoT and embedded systems.
- π: Cross-Platform: Write once, run on Linux, Windows, Mac, Android, WASM and Arduino/ESP32.
- π: Memory Efficient: Custom
ptr_t,queue_t,array_tandstring_tprimitives provide SSO (Small Stack Optimization) and zero-copy slicing. - π: Scalability: Build applications that can handle large workloads and grow with your needs.
- π: Open-source: Contribute to the project's development and customize it to your specific requirements.
- π: UTF Support: Comprehensive manipulation for UTF8, UTF16, and UTF32.
- π: Built-in JSON & RegExp: Full parsing and text processing engines.
- π: I/O Multiplexing: Support for Poll, Epoll, Kqueue, and WSAPoll.
- π: Reactive Programming: Built-in Events and Observers system.
em++ -o www/index.html main.cpp -lembind -I ./include \
--shell-file ./shell.html --bind \
-s NO_DISABLE_EXCEPTION_CATCHING \
-s ASYNCIFY=1 -s FETCH=1 -s WASM=1
emrun ./www/index.htmlem++ -o www/index.html ./test/main.cpp \
-I ./include -pthread --bind -lembind \
-s NO_DISABLE_EXCEPTION_CATCHING \
-s PTHREAD_POOL_SIZE=8 \
-s USE_PTHREADS=1 \
-s ASYNCIFY=1 \
-s FETCH=1 \
-s WASM=1
emrun ./www/index.html#include <nodepp/nodepp.h>
using namespace nodepp;
void onMain() {
console::log("Hello World!");
}#include <nodepp/nodepp.h>
#include <nodepp/http.h>
using namespace nodepp;
void onMain() {
fetch_t args;
args.method = "GET";
args.url = "http://localhost:6931/";
http::fetch( args )
.fail([=]( except_t err ){ console::log( err ); })
.then([=]( http_t cli ){
console::log( stream::await( cli ) );
console::log( "->", cli.status );
});
}#include <nodepp/nodepp.h>
#include <nodepp/ws.h>
using namespace nodepp;
void onMain() {
auto srv = ws::connect( "wss://localhost:8000" );
srv.onConnect([=]( ws_t cli ){
cli.onData([]( string_t data ){
console::log( data );
});
cli.onClose([](){
console::log( "done" );
});
});
}More Examples here
git clone https://github.com/NodeppOfficial/nodepp-wasm ; cd nodepptouch main.cpp ; mkdir ./www#include <nodepp/nodepp.h>
using namespace nodepp;
void onMain() {
console::log("Hello World!");
}em++ -o www/index.html main.cpp -lembind -I./include \
--shell-file ./shell.html --bind \
-s NO_DISABLE_EXCEPTION_CATCHING \
-s ASYNCIFY=1 -s FETCH=1 -s WASM=1
emrun ./www/index.html- π: NodePP for Window | Linux | Mac | Bsd
- π: NodePP for Arduino
- π: Nodepp for WASM
If you want to contribute to Nodepp, you are welcome to do so! You can contribute in several ways:
- β Buying me a Coffee
- π’ Reporting bugs and issues
- π Improving the documentation
- π Adding new features or improving existing ones
- π§ͺ Writing tests and ensuring compatibility with different platforms
- π Before submitting a pull request, make sure to read the contribution guidelines.
Nodepp-WASM is distributed under the MIT License. See the LICENSE file for more details.