Philippe Gaultier writes about systems programming, covering assembly, Wayland, Go data races, undefined behavior, Rust, and static site generators.
HN commenters link his Wayland and Go posts; one criticizes the mutex code in his data race article as obviously wrong.
> It's unsurprising that the author would go use Zig next time since they didn't seem to have any value alignment with Rust's core safety guarantees.
I don't think that's true. The end application talks to smart cards. See also one of the links: https://gaultier.github.io/blog/how_to_rewrite_a_cpp_codebase_successfully.md
However, the codebase has the possibility to use multiple memory allocators, and Rust is simply actively bad when faced with that.
It just seems like the codebase has a set of idioms that really lean into the areas that Zig is actively good at and where Rust is weak. Memory allocators, lexical (not RAII) defer, C interop, C++ interop, and cross-compilation are Zig's raison d'être, after all.
The one thing I disagree with is the complaint about "repr(C)". Sorry, but I've become convinced that if we want our compiler and languages to work well on modern hardware, we're going to have to allow the compilers to do lots of struct-of-array to array-of-struct (and vice versa) transformations depending upon the actual access patterns. That means that a struct or an array will not be locked to a specific memory layout unless you specifically request as such.
> I have been writing production applications in Go for a few years now.
sorry, what?
https://gaultier.github.io/blog/a_million_ways_to_data_race_in_go.html#improper-lifetime-of-a-mutex
this code is obviously wrong, fractally wrong
why would you create a new PricingService for every request? what makes you think a mutex in each of those (obviously unique) PricingService values would somehow protect the (inexplicably shared) PricingInfo value??
> the fix
https://gaultier.github.io/blog/a_million_ways_to_data_race_in_go.html#the-fix-2
what? this is in no way a fix to the problem.
it's impossible to believe the author's claims about their experience in the language, this is just absolute beginner stuff..
The first random page it returned to me was this — https://gaultier.github.io/blog/how_to_make_your_own_static_site_generator.html — which was about building one's own static site generator, which I really liked. I did not realise when I closed that page how hard it would be to find it again, because, of course every new visit to Kagi returns a different page :-)
Interesting to see an ebpf approach to this idea, some time ago I did the same with Dtrace: https://gaultier.github.io/blog/detecting_goroutine_leaks_with_dtrace.html
However I did not think of observing the ‘castgstatus’ runtime function.
Always nice to be able to compare the DTrace and Ebpf approaches, they both have different strong points.
I've seen some interesting work in doing Wayland by hand:
https://gaultier.github.io/blog/wayland_from_scratch.html
I'd also look at the work done on minimal wayland projects like [foot](https://codeberg.org/dnkl/foot), which supports wayland well and seems to be written by hand (see: https://codeberg.org/dnkl/foot/src/branch/master/wayland.c)
https://www.binwang.me/2023-12-14-ZFS-Profiling-on-Arch-Linux.html
https://gaultier.github.io/blog/x11_x64.html
https://diy.viktak.com/2022/04/home-made-tpm2-0-module.html
https://r.bluethl.net/how-to-design-better-apis
https://crystalverse.com/sodium-chloride-crystals/
https://twitter.com/Kristy_Viers/status/1287189581926981634