4 ms·
Jai does it to a degree that is certainly not common. C++ in particular only has true guaranteed compile time execution for constexpr functions in static_asser
by thethirdone 7y ago
Jai does it to a degree that is certainly not common.
C++ in particular only has true guaranteed compile time execution for constexpr functions in static_asserts and a few other small cases.
Jai on the other hand can do pretty much anything at compile time.
- unlinked_dll 7y agoconstexpr is Turing complete and it’s only limit is recursion depth of the compiler, which can be changed. And as of C++17/20 some of the weird stuff like not using conditionals and such isn’t present anymore. Also if you’re a masochist, the template system is Turing complete.
- thethirdone 7y agoI was not talking about the turing completeness of constexpr. There are only a few contexts in which constexpr functions are guaranteed to be evaluated at compile-time. This contrasts Jai's compile time only functions. Additionally, Jai can perform arbitrary IO at compile-time which is simply not possible with c++. One of the early demos had a program which played a videogame at compile-time.