Writing a Wayland Compositor in Zig - Isaac Freund

Channel:Zig SHOWTIME · Length:42:19 · Published:2020-05-31 · Views:26052

Watch on YouTube

Summary

Isaac Freund, author of the River Wayland compositor, talks about writing a Wayland compositor in Zig. He covers why he chose Zig over C and Rust and how Zig can wrap a hairy C library.

Why HN recommends it

HN recommends it as a phenomenal talk on Zig's C interop and on choosing between C, Rust and Zig for systems work.

I loved his Zig+Wayland screencast [1], where he explained very engagingly how Zig is able to embrace and extend a pretty hairy C library — HN, 2021

C, C++, Rust, Go & systems languages · Linux & open-source ecosystems

Subtitles (excerpt)

the next speaker is Isaac Freud Isaac is studying computer science in Aachen Germany and while most of these courses most of the courses in his university are about theory he spends the bulk of his free time playing around with Linux and Wayland which is more or less the same as what I did in university if you replace Linux with dota and Wayland we can't a strike anyway the talk is writing a Weyland compositor in Zig and so Isaac doesn't miss you're so right now what is Wayland I'm gonna explain it to you before we continue so way there's nothing more than a protocol for communication between a compositor and Wayland clients and so this is meant to be a replacement for x11 if you do not already know x11 is the display server used by Linux and other unix-like systems today is what clients or applications on your computer use to talk to the to display something on the screen or get access to infinite events from your keyboard or Mouse this this display server is responsible for managing all the output and input of your computer so how is wheeling differ from x11 let's look at this nice diagram taken from the whelen website so in X we have the X server which is the single server there's only one implementation of the X server and that everything

On Hacker News

Congratulations! And welcome Isaac, I loved his Zig+Wayland screencast [1], where he explained very engagingly how Zig is able to embrace and extend a pretty hairy C library and make it more memory safe, without forcing the implementor to rewrite or painfully try to bend it to the strict or idiosyncratic rules of the language, as it may happen with Rust or even Go. I can't wait for 1.0! Or at lea… — 1_player, 2021-12
this talk is phenomenal thank you. he explains (timestamp: [VIDEO] ) why he didn't go with Rust and it's quite puzzling what he says. I don't know enough about Rust if that's the case. To rephrase: "Rust was an obvious contender but it lacked good support for wlroots. there was a project which attempted to address this but they gave up after 12 months of work and 1000 commits. Rust's strong safet… — DyslexicAtheist, 2021-01
Rust does not bind well with C for this reason it can not become a system level programming [LINK] However, there is another programming language that does not need bindings. It is called Zig and here it explains how it solves the same problem [VIDEO] — rmanolis, 2021-12
The author of River has also done some fantastic talks, on Zig ShowTime [1] and at FOSDEM '21 [2]. [1] "Writing a Wayland Compositor in Zig" - [VIDEO] [2] "Zig: the perfect language for a Wayland Compositor?" - [LINK] — jorangreef, 2021-07
Another Wayland compositor written in Zig is ifreund/river [1]. Isaac, the author, gave a talk on choosing C vs Rust vs Zig on Zig SHOWTIME a while back [2] and also has an upcoming talk at FOSDEM 21 [3] [1] [LINK] [2] [VIDEO] [3] [LINK] — kristoff_it, 2021-01

Related videos