Is compile-time code generation considered or planned?
Basically the idea is that you can write regular program code (so here Roc) that is called by the compiler as part of the compilation process, in order to generate more code. Examples include Zig, Jai, F# type-providers
For example, you might turn a GraphQL schema into a GraphQL client at compile-time.
The advantages of this:
so there is a plan to do compile-time evaluation of constants (e.g. if I write foo = ...
at the top level, that will always get evaluated at compile time), which covers some of those use cases although probably not all of them
Some related discussion is in #ideas > Comptime metaprogramming for ROC
Ah yes, that's exactly what I mean. Thanks!
njlr has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC