Xorg server in zig

I came across this on YouTube and thought it was quite interesting.

9 Likes

Interesting ! Even though the project seems to be in its early stages, It be fun to have another big zig project to look at !

2 Likes

I had the idea to make an x server/client that resembled Wayland for a while, cool to see someone is doing it.

Yeah it is pretty cool. With Zigx providing an implementation of the x protocol for user apps that’s not bloated, zig might just keep xorg around.

Yep, I’ve contributed to Zigx as well. But also I’ll eventually move the protocol code to a separate repository and it should automatically work both as a client and server library. It constructs the protocol messages automatically from struct definitions using zig comptime.

5 Likes

Good work! Perhaps you should now switch to the Zig version 0.16 dev 1859 released yesterday, which features the new I/O interface. This brings a lot of improvements, even if it does require some additional work. But it’s worth it. See here: https://codeberg.org/ziglang/zig/pulls/30232

I did take a look at upgrading before but the removal of LinearFifo + switch to Io interface makes it painful. Phoenix uses LinearFifo(.Dynamic) for sendmsg/recvmsg for the data and file descriptors sent/received. I know that the Io interface itself is a fifo and Deque exist but they are not usable replacements in themselves for my use case and i’ll probably have to reimplement LinearFifo myself (efficiently). Maybe I missed something, but that was what it looked like when I took a quick look at it. The upgrade wasn’t worth the effort as it would stall development.

1 Like

You can simply copy the fifo.zig file into your project and adapt it. Then you’ll have everything at once.

2 Likes