Using reflection for HPC/numerics
Hi!
TL;DR: I want to use C++26 for my bachelor thesis. The goal is to use reflection / metaprogramming to solve a real problem in HPC / numerics.
Context:
I started learning C++ a few years ago and gradually fell in love with the language. Once I began to understand (if that’s even possible) how it works under the hood it turned into a bit of an obsession. It’s amazing what can be done at compile time, and I’m very excited for reflection to finally become broadly available.
I’m currently looking for a bachelor thesis in HPC/numerics. While there are excellent modern libraries like Eigen or Kokkos, a lot of code that actually runs on clusters is “C with classes” or early C++11/14. Many available projects at my university involve working on large, legacy codebases that exist to produce results (or PHDs) rather than to be pleasant to work with. This is understandable from their perspective, but not very motivating for me.
I’d much rather build a proof of concept or a small library/framework that tackles painful problems that exist today. I have some ideas already, but nothing fully convinces or excites me as of now.
Now to my question:
Do you have ideas or suggestions for a C++ library or framework that solves a real problem in HPC / numerics using reflection/metaprogramming?
Current ideas:
AoS ↔ SoA converter
kind of boring
essentially an example in [P2996R4](https://isocpp.org/files/papers/P2996R4.html)
Jolly Chen is already actively working on this (GitHub)
MPI wrapper
data marshalling is painful - automating that part might be interesting
compile-time safety could eliminate entire classes of bugs
Type-safe physical units
[already exists](https://github.com/boostorg/units) in [many forms](https://github.com/nholthaus/units) sounds very fun
probably not thesis-worthy on its own
Introspect/modify expression trees
build on top of Eigen → probably hard to improve and harder to integrate
write a custom framework → likely useless in practice
Grid/field layout framework
halo regions → descriptors + MPI exchange schedules
named fields/axes → safe indexing + dimension checks
Framework for versioned binary I/O
something HDF5\-like, but lighter
bulk binary I/O for AoS / SoA
automatic, stable schema IDs derived from reflected types
Thank you for your time!
https://redd.it/1q4k25r
@r_cpp
Post #24641
28