Parsing JSON at compile time with C++26 static reflection (lemire.me) 6 points by kristianp 19d ago ↗ HN
[–] kristianp 19d ago ↗ This is basically a demo for simdjson's static reflection feature:> Recent versions of simdjson can parse JSON at compile time using C++26 static reflection. The entry point is simdjson::compile_time::parse_jsonRequires language support, for example using gcc 16. Impressive feature! #define SIMDJSON_STATIC_REFLECTION 1 #include "simdjson.h" constexpr const char json_data[] = { #embed "data.json" , 0 }; constexpr auto window = simdjson::compile_time::parse_json<json_data>();
1 comment
[ 3.0 ms ] story [ 13.6 ms ] thread> Recent versions of simdjson can parse JSON at compile time using C++26 static reflection. The entry point is simdjson::compile_time::parse_json
Requires language support, for example using gcc 16. Impressive feature!