Printing declartion to file

I have a pre-calculated array [32768]u15 which i want to transform to a const array inside my source code.

I can:

  • Calculate the const at comptime. Can I submit the compiler to some calculation (15 loops per element)?
  • std.debug print the array and copy paste to a zig file.
  • or somehow print to a file instead of std.debug.print? does Zig have something quick and dirty for that?

If this array is in a binary file, with elements adjacent to each other, you can just @embed the file. You might have to do some work to change the type from [_]u8 to [_]u15, though.

True, then i first have to write the raw bytes to a binary file.
It is also nice to see directly the bits in the sourcecode. I think I will make a const from it