I’m not totally sure I understand what you’re trying to do, so I’ll give a general answer (I have a feeling there might be some sort of misunderstanding of comptime
involved here, but I can’t tell).
You can get around the lack of heap allocation at comptime by either precomputing the size of the array you’ll need, using an upper bound of the array length you need, or concatenating arrays together.
However, doing anything as intensive as you’re talking about will hit comptime currently being absurdly slow very quickly.
If you really want to do something intensive at compile-time, you might end up needing to write something that generates Zig code, either via a custom build step or just a program that outputs a .zig
file that gets built and run during the build process. Here’s an example of a custom build step: