NumC - The ultimate mathematics framework for modern C++.

NumC is a modern, high-performance, purely declarative mathematical framework written entirely in C++20 with zero external dependencies. It brings the expressive elegance of Python's NumPy/SciPy/Matplotlib ecosystem into the world of compiled, statically-typed C++ — without sacrificing a single cycle of performance. Everything — from neural networks to FFT to publication-quality SVG rendering — is implemented from scratch in pure standard C++.

Add a comment

Replies

Best
NumC is a modern C++20 scientific computing framework designed to write mathematics exactly the way you think it, rather than how the compiler demands it. It is 99% header-only and has zero external dependencies (no Eigen, no Boost, no FFTW). Everything—including an SVG graph renderer, native Win32 plotting windows, MLP neural networks with Adam optimizer, and adaptive ODE solvers—is implemented from scratch in pure C++20. It utilizes lazy evaluation via internal expression trees (func), allowing you to compose complex multivariable functions, map them over data tensors, or pass them directly to numerical differentiation and integration routines with natural mathematical syntax. Repo: I wanted to create a lightweight alternative for compiled environments that mimics the expressive freedom of NumPy/SciPy while retaining static typing and C++ performance. I'd love to hear your thoughts on the API ergonomics and implementation.

Having NumPy parity in C++ sounds amazing, especially for compute-heavy work. One thing that would make this a daily driver for me is built-in support for sparse arrays and linear algebra, since dense tensors only get you so far once you're dealing with real-world data like graphs or recommendation systems.

 Linear algebra and sparse matrices are supported and very easy to use. Of course, in terms of performance, NumPy might be superior for certain algorithms (NumPy/SciPy/scikit-learn use pre-compiled C/Fortran libraries (like OpenBLAS, LAPACK) heavily optimized for specific hardware architectures with SIMD instructions (AVX/AVX512)), but they can be implemented better and faster in NumC (check the benchmarks).


Honestly didn't expect zero-dependency C++ to feel this clean. The fact that neural nets, FFT, and SVG rendering all live in pure standard C++ is kind of wild.

Having zero deps and doing FFT plus SVG rendering all in pure C++20 is genuinely impressive, really nice work.