Open Cloudef opened 10 months ago
Might be interesting as well https://github.com/ziglang/zig/pull/17731
It doesn't say anything about expressions and I assume this will be the official zon spec. I'll update the zon2json to use this once it's landed.
Are you aware of https://github.com/nix-community/zon2nix?
@dermetfan Yes it is actually one of the reasons I started doing this, because it could not handle recursive dependencies, and can't handle recent .zon formats.
While zon2json works right now for any
build.zig.zon
files I've thrown at it. The ast walker itself isn't really complete.Zon files itself are literally zig structs, so they may contain actual zig expressions I don't intend to maintain a zig interpreter soconsider instead making zon2json a program that depends on zig compiler that generates a program that does something like:This would make sure zon files are always handled properly. cons might be speed, but zig should cache the outputs.
At some point it might become possible to import zon files as well: https://github.com/ziglang/zig/issues/14531
ref: https://github.com/ziglang/zig/issues/15552