The features under development in the macocaml sysytem in the modular macros project will solve this problem, but it’ll be a little while before they’re ready for general use. Once they are, you’ll be able to define a (type-safe) compile-time function that generates the data structure during compilation and inserts it into the compiled code.
5 Likes