Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Curious about the choice of Zig, any specific reason for using it?


The main reason Zig was chosen is because the project was started at a hackathon[0] at which there was a prize for "best use of Zig". Beyond that there were also other reasons: 1. I have been wanting to try out Zig 2. It fit the requirement of being a so called "systems language".

However having written it in Zig I have a few retroactive reasons for why Zig was a good choice (if not the best choice):

* The build system allows to make the runtime a dependency of the "compiler". I don't think any other language has that.

* The interoperability with C/systems calls is amazing (in comparison to anything but C/C++)

* The ability to embed files

* Makes it incredibly easy to make static binaries

[0]: https://treehacks.com/

[1]: https://github.com/NilsIrl/dockerc/blob/68b0e6dc40e76c77ad0c...


Probably because it has a super nice build toolchain, especially when you consider cross compilation.

There's quite a few folks using zig _just_ for the toolchain, while still writing C.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: