TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24652 26
Hahaha: Lightweight C++ ML Library - Easy Tensor Ops & Autograd for All Levels!

Hi everyone!

I'm Napbad (with my collaborator JiansongShen), and we're both not C++ experts, but we've been building Hahaha - a lightweight C++23 library for numerical computing and machine learning basics. It's like a mini PyTorch in C++, with tensor ops, auto-differentiation, neural layers, and a simple ML training CLI demo. We started this as a learning project, and now we want to share it with fellow beginners!

Why we think it is great for C++ newbies?

Hands-On Learning: Core features like broadcasting, sum/reduce, and backward propagation are implemented cleanly. You can dive into the code to see how ML works under the hood - no black boxes!
Documented Decisions: Check our dev docs (https://jiansongshen.github.io/HahahaDevDocument/) - we logged every architecture choice, from adding CI/CD to choosing Meson/CMake. It's like a "how-to-build-a-project" guide.
Engineering Best Practices: We gradually added pro features: GitHub Actions CI with 80%+ line coverage (forced!), clang-tidy/format, Doxygen API docs (live at [https://napbad.github.io/Hahaha/](https://napbad.github.io/Hahaha/?referrer=grok.com)), and Docker for easy setup. Perfect for learning modern workflows without overwhelm.
Newbie-Friendly: Simple API (e.g., tensor creation with init lists), and we're open to PRs - even small ones like fixing typos or adding tests. No gatekeeping!

For more experienced devs (veteran in C++ or ML): We've got a solid foundation with C++23 features, templates for generics, and recent additions like CMake support and optimized error handling. We're aiming to expand with more optimizers (e.g., Adam) and GPU acceleration. Could you please provide some suggestions (if it doesn't take up your time)? Your input on performance tweaks or advanced features would be awesome!

Repo: https://github.com/Napbad/Hahaha (Apache 2.0 license - help us grow!)

We've got a task roadmap in docs (e.g., adding more optimizers like Adam), and we're committed to long-term maintenance. If you're learning C++ and interested in ML, fork it, run the autograd demo or visualizer, or suggest features. Questions? DM me or open an issue - we're super friendly!

What do you think? Any tips for us beginners? 😊

https://redd.it/1q8ck6s
@r_cpp
jiansongshen.github.io Preface - HahahaDevDocument Development notes, design docs, and architecture decisions for the Hahaha project (mdBook).
More from @r_cpp
  1. Oct 8, 2026Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026 https://youtu.be/…
  2. Oct 8, 2026How to Fix autoconf-style Configuration Probing https://build2.org/blog/fix-autoconf.xhtml…
  3. Oct 8, 2026owl – a header-only C++23 HTTP framework where route patterns and handler extractors are c…
  4. Oct 8, 2026Removed by Reddit Removed by Reddit on account of violating the [content policy. ] https:/…
  5. Oct 8, 2026Is there a way to search across all P and N papers throughout standardization history? It…
  6. Oct 8, 2026CppCast Episode 412 : Safety and Interoperability with Rust and C++ https://cppcast.com/sa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →