Whoa, this is really interesting.
However, I am confused:
- “Avoid glue C code” - how does it achieve its target then?
- I have tried building the project (
git clone https://github.com/lassade/c2z.git
,cd c2z
,zig build
), got this error:
zig build-exe zbg Debug native: error: the following command failed with 1 compilation errors:
/home/archie/apps/zig/zig build-exe /home/archie/projects/c2z/src/main.zig --cache-dir /home/archie/projects/c2z/zig-cache --global-cache-dir /home/archie/.cache/zig --name zbg --mod clap::/home/archie/projects/c2z/libs/zig-clap/clap.zig --deps clap --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
install zbg transitive failure
zig build-exe zbg Debug native 1 errors
src/main.zig:94:22: error: invalid builtin function: '@intToFloat'
(100.0 * @intToFloat(f64, transpiler.nodes_visited) / @intToFloat(f64, transpiler.nodes_count)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(zig version 0.11.0-dev.3803+7ad104227
)
Am I even supposed to build it?
I must admit I am too dumb to understand how to use your tool. I have a very vague understanding of compilers’ inner workings…
Edit: either I’ve gone bananas, or they have changed @intToFloat
to @floatFromInt
: https://ziglang.org/documentation/master/#floatFromInt