A while ago, I started building LightnerX, a networking library for a multiplayer game I'm developing.
When I first wrote it, I decided to use C++26 and modules. I liked the idea of using modern C++ features, and since I was developing everything myself, compatibility wasn't a huge concern.
Then I released the library.
And I started questioning that decision.
The problem wasn't the language
I actually enjoyed working with modules. Having explicit imports and organizing the library around modules felt pretty clean.
But there was a practical issue.
LightnerX is supposed to be integrated into other C++ projects. Requiring developers to use C++26, along with toolchains capable of handling modules, made that unnecessarily complicated.
The library wasn't doing anything that fundamentally required C++26.
Most of its functionality could work perfectly well with an older standard.
So I decided to migrate the entire project to C++17.
Goodbye, modules
The first major change was replacing modules with traditional headers and implementation files.
For example, instead of importing a module:
import lightnerx.network.server;
The C++17 version uses a header:
include
That sounds simple, but the migration involved more than changing "import" to "#include".
The original project had 14 library modules. Their dependencies, declarations, and implementations needed to be reorganized while keeping the public functionality intact.
I also had to revisit the CMake configuration, which previously depended on experimental module support.
What about std::span and std::expected?
This was another compatibility problem.
"std::span" was introduced in C++20, while "std::expected" arrived in C++23.
Neither belongs to C++17.
I needed alternatives without giving up the functionality those types provided.
The current LightnerX implementation uses "tcb::span" for non-owning byte views and "zeus::expected" for result handling.
This allowed the library to preserve those programming patterns without requiring a newer language standard.
Keeping the behavior consistent
My main concern wasn't whether the new code would compile.
It was whether changing the implementation would accidentally change how the library behaved.
LightnerX handles connections, message interpretation, callbacks, and outgoing message batching. Those components have plenty of places where small mistakes can cause problems.
I had already learned that lesson during an earlier technical audit, when I discovered a bug involving connection ID recycling after repeated connection cycles.
For the migration, automated tests and technical reviews were essential.
I wanted the C++17 version to preserve the same communication model and behavior, including error handling and message ownership.
The goal was compatibility, not redesigning the library.
Was it worth it?
For this project, I think so.
I still like modern C++, and I don't think using modules was inherently a bad decision.
But I was building a reusable library, not just an application for myself.
That changed my priorities.
The library now targets C++17, uses traditional public headers, and can be integrated without requiring experimental C++ module support.
There's still plenty of work ahead, but at least the language standard is no longer such a significant barrier.
![Physical AI Foundations and Definitions — Ch.10: Future Directions [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgz7t8gzrdba0obh9ma56.png)
![Physical AI Foundations and Definitions — Ch.08: Physical AI Product Strategy [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4gyormoamcida6t18mdw.png)
![Physical AI Foundations and Definitions — Ch.07: Relation to AMR Manipulator Humanoid Quadruped UAV [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fte7aqbjpqzqiay6cht0x.png)
![Physical AI Foundations and Definitions — Ch.05: Physical AI Taxonomy [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxeb66tbhskewzsz49i7p.png)