Comment by ChickeNES

13 hours ago

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

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

  • What does that have to do with portability? It doesn’t support a bunch of CPU architectures, the portability metric I care about.

    • I misread the comment I was replying to, thinking it was about using Zig to port something, when it was actually about porting something that uses Zig.

Zig is even more portable than C

  • You’re kidding right? That’s not what the support matrix on the Zig site shows. Plenty of CPU archs in Tier 3/4. No support for Alpha, HPPA, M68K, Sparc, or SuperH.

    • "portable" and "has ports" mean two different things. there might be targets Zig doesn't have great support for yet but what I meant is that bootstrapping a target to Zig is a simpler endeavor than it is for C

      1 reply →