logoalt Hacker News

ChickeNES • yesterday at 9:25 PM • 3 replies • view on HN

Isn’t it written in Zig? Not sure how that is “highly portable” compared to C


Replies

fwlr • yesterday at 10:11 PM

From https://ziglang.org/intro/overview/

  Zig is also a C compiler

  Here’s an example of Zig building some C code:

  hello.c
  > #include <stdio.h>
  >
  > int main(int argc, char **argv) {
  >   printf("Hello world\n");
  >   return 0;
  > }
  

  $ zig build-exe hello.c -lc
  $ ./hello
  > Hello world
➕ show 1 reply
8n4vidtmkvmk • today at 12:16 AM

I/my agent somehow integrated it into a C++ app on Windows. So one way or another, it does work.

nektro • yesterday at 10:51 PM

Zig is even more portable than C

➕ show 1 reply