Stream: ideas

Topic: Zig build for basic webserver


view this post on Zulip Zak Kohler (Sep 27 2026 at 18:56):

https://github.com/roc-lang/basic-webserver/pull/236

This is just an experiment to see if zig build were possible.

I know we have all the tests in Python still, so that would be a lot of migration.

view this post on Zulip Luke Boswell (Sep 27 2026 at 20:04):

We will probably swap out our scripts to Roc before we use Zig for acripting. We have avoided using Roc on the main repos pre 0.1 just to avoid the problem of stability and breaking changes making upgrades painful.

view this post on Zulip Luke Boswell (Sep 27 2026 at 21:45):

I've switched roc-pandoc over already as a bit of a pilot project https://github.com/lukewilliamboswell/roc-pandoc/tree/main/scripts

My plan is to replace the scripts for all my repos one at a time and help validate the basic-cli API etc before we commit to the core Roc ones.

view this post on Zulip Luke Boswell (Sep 27 2026 at 21:47):

There is some experimentation here around what does scripting look like in Roc -- and I've tried a few different things already.

view this post on Zulip Zak Kohler (Sep 27 2026 at 22:12):

That sense makes to me. I wonder zig build buys anything in coordination, even if just to match the roc compiler build. I thought heard it was designed to be a good build tool even for non zig code, but I don't have actual experience in that.

view this post on Zulip Luke Boswell (Sep 27 2026 at 22:25):

I have used both Zig and Roc for build scripts and I may be a little biased here ... but I think Roc is definitely more suited to this use case :wink:

view this post on Zulip Luke Boswell (Sep 27 2026 at 22:27):

Zig is probably more mature, though it is also still changing between versions.

view this post on Zulip Luke Boswell (Sep 27 2026 at 22:27):

Using Roc like this is a good way to help us validate our designs and get real world experience.

view this post on Zulip notramo (Sep 29 2026 at 07:45):

That sense makes to me. I wonder zig build buys anything in coordination, even if just to match the roc compiler build. I thought heard it was designed to be a good build tool even for non zig code, but I don't have actual experience in that.

Non-Zig code usually means C and C++, since Zig can compile these itself, without external tools (zig cc). And Zig has builtin caching for C and C++ compilation, which gcc/clang does not have. So a Zig build system brings much benefit for building C projects. However, for Roc, the Zig build system would still need to call an external compiler (roc), which uses its own caching, so there's not much benefit to using it.

view this post on Zulip removewingman (Oct 01 2026 at 22:01):

I think these are different demands in terms of scripting, for building with anything C/C++ related I would use Zig.

But afaik Roc tries to replace python scripts.

I using right now posix shell scripts for really small stuff and janet for a little bit bigger scripts, could have a look at janet to get inspiration.


Last updated: Oct 15 2026 at 17:56 UTC