A snippet from the paper that made me understand what this is about:
// $ is the reflection operator and T is a type.
constexpr { // execute this at compile time
for... (auto m : $T.variables()) // examine each member variable m in T
if (m.name() == “xyzzy”) // if there is one with name “xyzzy”
-> { int plugh; } // then inject also an int named “plugh”
}
This would inject "int plugh;" in the scope surrounding the constexpr block.
I have hopes that Jai will be at a very nice local optimum regarding performance and productivity, but I think just like in C++, safety is not a major design goal (you need to be unsafe if working with memory mapped structs).
> you need to be unsafe if working with memory mapped structs
Perhaps when defining their address and layout, or if they are a hardware structure that affects memory like a page table or TLB or a DMA controller, but beyond that, why? Or is that just the main use case you're describing?