In ancient times, it was believed that the Earth rested on three whales.
Software “whales”:
Linux
macOS
Windows
(The order is according to the English alphabet)
And although Zig is theoretically mostly OS-independent,
the code does not always run smoothly on all platforms (at least in my own projects).
The purpose of the poll is to determine the usage of the language on this trio.
This will help answer the questions:
For which OS to develop and test for first
How well Zig itself is tested on this OS.
I emphasize - this is not about desire (of course, we want it to run on everything),
but about the current situation.
Therefore, I chose a simple criterion - the use of ‘zig build test’ for this OS on GitHub or similar platforms,
because it indicates active development and testing.
It depends on the target user. If your target is other developers, test on Linux. If your target is ordinary PC users, test on Windows.
Personally, I’m not very comfortable developing software for macOS; it’s a very developer-unfriendly platform! But if you’ve already passed Linux testing, testing on macOS isn’t difficult.
Might be a hot take, but IMHO the best format for this kind of stuff is ‘relaxed’ json with trailing commas and comments, and a json schema (which allows code completion). The problem with YAML is that it requires a very complex parser (eg 5kloc for the defacto standard python yaml parser)
I run CI on all three (plus WASM for some projects) but sometimes remove either Windows or macOS from the build matrix because something broke in the Zig nightly (while breakage on Linux seems very rare, I guess Zig is mostly developed on Linux)
(Just for prevention of some responces - most time I developed for Windows, from device driver to distributed proprietary file system.
So “nothing presonal”)
Well, from experience of library developers developing Windows first leads to less problems down the line and a cleaner design because of the way Windows handles dynamic linking.
And well, I see Zig as a systems programming language which includes writing libraries which are usable from OTHER languages.
But of course, not every library is intended to run on every operating system. For example why should you test a iouring library on Windows (and how would you even do that)?
One consequence of the differences in Windows vs. POSIX symbol handling is that there is no such thing as the C runtime or the STL on Windows. Every module (EXE or DLL) choses which C/C++ standard library it uses. You can’t assume that memory allocated by malloc/new in one module can be released by free/delete in a different module. You can’t assume that STL objects like std::vector can be shared across modules.
You can avoid these problems if you control all of the modules, can dictate how they’re built, and force them to use the same standard runtimes. But it only takes one external DLL dependency to ruin that plan.