Story Details

  • Show HN: Hexi – Modern header-only network binary serialisation for C++

    Posted: 2025-03-28 17:37:42

    Hexi is a new, header-only C++ library for network binary serialization. It focuses on modern C++ features, aiming for ease of use, safety, and performance. Hexi supports user-defined types, standard containers, and common data structures out-of-the-box, minimizing boilerplate. It leverages compile-time reflection and constexpr processing to achieve efficiency comparable to hand-written serialization code, while providing a more concise and maintainable solution.

    Summary of Comments ( 38 )
    https://news.ycombinator.com/item?id=43508061

    HN commenters generally praised Hexi for its simplicity and ease of use, particularly its header-only nature and intuitive syntax. Some compared it favorably to other serialization libraries like Protobuf and Cap'n Proto, highlighting its potential for better performance in certain scenarios due to its zero-copy deserialization. Concerns were raised about potential compile-time impact due to the header-only design and the lack of documentation beyond basic examples. One commenter suggested incorporating compile-time reflection to further enhance the library's capabilities and reduce boilerplate. Others questioned the long-term viability of the project, expressing a desire to see more real-world use cases and benchmarking data. The lack of support for optional fields was also mentioned as a potential drawback.