logoalt Hacker News

Phoenix: A modern X server written from scratch in Zig

312 pointsby snvzzyesterday at 10:43 PM147 commentsview on HN

Comments

sho_hnyesterday at 11:12 PM

Pretty interesting approach to make an X server that is essentially "Wayland-like" (merging display server/compositor by default, isolated apps by default, no remoting of GLX, dropping legacy protocol features to the point of breaking compat with the core protocol, etc.). Not sure who this is for, but by itself it looks like a fairly reasonable set of choices.

show 3 replies
socketclustertoday at 3:40 AM

The name Phoenix is overused. There is an Elixir framework called Phoenix. I think I also heard of other projects with that same name before.

It's a bit like the name 'Apollo'; besides the moon landing project, I know like 2 dev projects called that and also there is a sales SaaS platform with that name.

Surely people should run a search first before choosing a name...

show 3 replies
ccakesyesterday at 11:14 PM

This is a great project! I like and use Wayland but the portal protocols and extension mechanism does leave a lot to be desired. Wayland is still quite a way behind Windows and macOS in terms of what productivity users need

An X11 rewrite with some security baked in is an awesome approach. Will be watching!

show 4 replies
iamnothereyesterday at 11:56 PM

This is the kind of initiative I’d prefer to see from X preservationists. Great job, I hope it succeeds. I prefer Wayland, but there’s still a place in the world for X; it just needs new dev teams to shoulder the burden.

show 1 reply
shevy-javatoday at 2:44 AM

I have no idea how well this one works, but I am all up for more projects that can compete against the singularization that corporations currently try (see paid developers for wayland, GNOME and now also KDE). I wonder how much money would be needed to make the xorg server adapt to the modern era; I don't even know the featureset that is missing for this either. But I also know that wayland, after 20 years (!!!), will never cover those requests users had over tohse 20 years, simply because it tries to cater to a narrow specification wanted by corporations rather than the people - so much is now clear (wayland protocol was released in 2008, so it is soon 20 years actually; in a few days we have 2026, so it will be 18 years).

AndyKelleytoday at 12:32 AM

As the application author you can set the release mode in the build script so that the release flag looks like `zig build --release` instead, and the user doesn't choose the optimization mode.

As a user you can pass `--release` to `zig build` to request release mode. If the application doesn't want to pick for you, you'll get an error and then you can pick for yourself.

In this case, it looks like the author of Phoenix wants to choose ReleaseSafe as the official release mode of the application.

Phoenix is the name of my hometown, btw.

PixelForgtoday at 4:42 AM

Same author behind https://git.dec05eba.com/gpu-screen-recorder/about/ , the best screen recorder for wayland imo (I had tried other alternatives but none of them helped in recording at 4k 60fps, this worked out of the box).

vzalivayesterday at 11:41 PM

Multiple screens support is listed as non-goal. Would that prevent its usage with window managers which support virtiaul desktops? I am i3 user and it is a critical feature for me.

show 2 replies
__dtoday at 2:15 AM

So … does xterm work? emacs? xfig? ghostview? xload? xev? oclock? xmodmap? xpilot?

show 1 reply
superb_devyesterday at 11:03 PM

> The compositor will get disabled … if the client runs a fullscreen application and disabled vsync in the application.

This is interesting to me, why would vsync being enabled mean that the desktop compositor needs to stick around for a full screen app?

show 1 reply
ori_btoday at 4:46 AM

Seems interesting that they're not using the XML protocol specs for code gen, the way the Xorg server does.

s08148692yesterday at 11:10 PM

First my mind went to Phoenix (elixir framework), then to X (twitter) before it clicked what this was actually about. Some very overloaded names

show 4 replies
vitalnodoyesterday at 11:48 PM

Another potentially interesting project is zigx, an X11 client library for Zig applications:

https://github.com/marler8997/zigx

https://www.youtube.com/watch?v=aPWFLkHRIAQ

Compared to libX11, it avoids dynamic dependencies, uses less memory, and provides better error messages.

smj-edisontoday at 12:37 AM

Bit of an observation, but I've noticed that there's been quite a few pragmatic projects started in Zig. Bun vs Deno comes to mind (one focused on DX, the other on security), and now this vs Wayland. Not to say that designing something properly is wrong, just that it tends to throw away a lot of important interoperability.

grumpstoday at 1:05 AM

I finally caved and switched to Wayland 6 months ago or so. Things just work so much more smoothly.

show 1 reply
gldrkyesterday at 11:11 PM

If you are not going to implement X11 drawing ops and XRender (which I, and many others, still use heavily), what's even the point? Any 'modern' program that only does client-side rendering already supports Wayland. AFAIK GTK 3 doesn't even support DRI on X11 unless you somehow trick it into using the abandoned OpenGL Cairo backend, but that's not modern enough apparently.

show 3 replies
kombineyesterday at 11:04 PM

Are different DPIs for different monitors supported too?

immibistoday at 3:27 AM

Nice! We do need more X servers, since Wayland refuses to incorporate essential protocol elements due to religion.

show 1 reply
Levitatingtoday at 1:40 AM

No active development in the last 4 months?

dismalaftoday at 1:46 AM

Cool project I guess, don't see the point but technically interesting. Will be cool to have another modern display protocol/server. I personally would have rewritten Wlroots in Zig or something, but I guess this is more interesting.

shmerltoday at 1:12 AM

So this can be an interesting option for XWayland?

show 1 reply
snvzzyesterday at 11:06 PM

Complements XLibre[0], an active fork of the X11 server from Xorg.

XLibre is trying to advance the existing implementation which Xorg abandoned, whereas Phoenix is writing a new, compatible server from scratch.

0. https://github.com/X11Libre/xserver

show 1 reply
sergiotapiayesterday at 11:03 PM

[flagged]

show 2 replies
bnolsentoday at 12:03 AM

It's christmas and not april fools!

show 1 reply