Skip to content

A runtime for writing reliable asynchronous applications with C++. Provides I/O, networking, scheduling, timers, ...

License

Notifications You must be signed in to change notification settings

NodeppOfficial/nodepp

Repository files navigation

Nodepp: The Unified Asynchronous Real-Time C++ Runtime

MIT License Platform Build Status

Nodepp is a vertically integrated C++ runtime engineered to solve the Efficiency Paradox of modern distributed computing. While managed runtimes prioritize developer velocity at the cost of hardware overhead, Nodepp delivers industry-leading throughput with a near-zero resource footprint through deterministic memory management and hardware-aligned architecture.

By unifying the event reactor, protocol parsers, and memory controller into a single architectural DNA, Nodepp eliminates the Abstraction Tax that inflates infrastructure costs and energy consumption.

Whitepaper

Scaling the Talent Bridge for Green Computing: Achieving Silicon-Logic Parity through Deterministic RAII — A Roadmap for Distributed Systems in the Post-Moore Era and Heterogeneous System Fragmentation. Read the full technical breakdown, including architectural deep-dives into ptr_t, kernel_t and coroutine_t.

Sustainability & Performance (Green Computing)

Nodepp is designed for Resource Density. While modern runtimes often throw hardware at the problem, Nodepp optimizes the software to respect the silicon. By reducing memory overhead and CPU jitter, we directly decrease the energy footprint of digital infrastructure.

Performance Benchmark: HTTP Throughput vs. Resource Tax

Test: 100k requests | 1k Concurrency | Environment: Localhost | Device: Educational-grade Dual-Core Apollo lake Chromebook see benchmark

Metric Bun (v1.3.5) Go (v1.18.1) Nodepp (V1.4.0) Impact
Requests / Sec 5,985 6,139 6,851.33 +11.6% Performance
Memory (RSS) 69.5 MB 14.1 MB 2.9 MB 95.8% Reduction
Max Latency 1,452 ms 326 ms 245 ms Elimination of GC Spikes
p99 Latency 1,159 ms 249 ms 187 ms High-precision SLA stability
Energy Efficiency Low Medium Extreme Maximum hardware utilization

Performace Benchmark: Resource Management & Latency Jitter Analysis

Test: 1k Cycles | 100k Allocations | Environment: Educational-grade Dual-Core Apollo lake Chromebook see benchmark

Runtime Avg. Cycle Time VIRT (Address Space) RES (Physical RAM) Memory Model
Nodepp 3.0 ms (±0.1 ms) 6.1 MB 2.7 MB Deterministic RAII
Bun 7.2 ms (5-11 ms range) 69.3 GB 72.6 MB Generational GC
Go < 1.0 ms* 703.1 MB 2.2 MB Concurrent GC

Note: Go's <1ms measurement reflects allocation latency only; reclamation is deferred to concurrent garbage collection cycles.

Why this matters for Green IT:

  • Infrastructure Density: Nodepp's 2.9 MB footprint enables 23× more services per physical host compared to Bun, reducing hardware requirements and data center cooling loads.

  • Deterministic Energy Draw: By eliminating garbage collection spikes, Nodepp maintains stable CPU utilization, extending IoT battery life and lowering cloud power consumption.

  • E-Waste Reduction: Nodepp's ability to run advanced asynchronous logic on 8-bit/32-bit microcontrollers prevents hardware forced obsolescence, extending the usable lifetime of existing hardware.

Architectural Philosophy

Engineering Principle: Mechanical Sympathy

Rooted in Electrical Engineering principles, Nodepp implements hardware-centric design patterns to mitigate the systemic flaws of high-level runtimes:

  • Deterministic Latency: Eliminates the unpredictable spikes of Garbage Collection (GC) through manual, reference-counted memory safety.

  • Zero Heap Fragmentation: Employs a fragmentation-resistant memory model ptr_t optimized for long-running asynchronous processes.

  • Scale-Invariant Logic: Enables the same high-level logic to run with parity across the hardware spectrum — from 8-bit microcontrollers to 64-bit clustered cloud servers.

Integrated Protocol Stack

Nodepp implements its own protocol parsers ( HTTP, WebSocket ) specifically to ensure they are Poll-Aware. By building these engines directly on the kernel_t reactor core:

  • Mechanical Sympathy: Data moves from the system-socket directly into logic. This removes the Copy Tax found in generic libraries.

  • Cache Locality: Sharing the memory logic with the core reactor keeps data hot in the L1/L2 cache, significantly reducing latency jitter.

Core Implementation & Platform Reach

  • Reactor Backends: Supports native event-multiplexing via Epoll (Linux), IOCP (Windows), Kqueue (BSD/Mac) and busy-while loop ( embedded systems ).

  • Concurrency Model: Shared-nothing architecture with isolated workers to prevent lock contention.

  • Cross-Platform Parity: Designed to maintain logic consistency across 8-bit/32-bit Microcontrollers (Arduino), WebAssembly (WASM), and POSIX-compliant operating systems.

Technical Example: Asynchronous Observation

This example demonstrates the integration of the event loop with a basic HTTP reactor, showcasing the unified API style.

#include <nodepp/nodepp.h>
#include <nodepp/regex.h>
#include <nodepp/http.h>
#include <nodepp/date.h>
#include <nodepp/os.h>

using namespace nodepp;

void onMain() {

    auto server = http::server([]( http_t cli ){
        
        cli.write_header( 200, header_t({
            { "content-type", "text/html" }
        }) );

        cli.write( regex::format( R"(
            <h1> hello world </h1>
            <h2> ${0} </h2>
        )", date::fulltime() ));

        cli.close();

    });

    server.listen( "0.0.0.0", 8000, []( socket_t /*unused*/ ){
        console::log("Server listening on port 8000");
    });

}

Ecosystem

The Nodepp project is supported by a suite of modular extensions designed to follow the same unified design patterns:

One Codebase, Every Platform

Nodepp is the only framework that lets you share logic between the deepest embedded layers and the highest web layers.

Contributing

Nodepp is an open-source project that values Mechanical Sympathy and Technical Excellence.

  • Sponsorship: Support the project via Ko-fi.
  • Bug Reports: Open an issue via GitHub.
  • License: MIT.

ko-fi

License

Nodepp is distributed under the MIT License. See the LICENSE file for more details.

About

A runtime for writing reliable asynchronous applications with C++. Provides I/O, networking, scheduling, timers, ...

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 5

Languages