Pgwm 0.3 a pure rust `no_std` no libc window manager.
Pgwm 0.3, tiny-std
It's been quite some time since I last published an update to pgwm
and posted this.
I've been pretty busy, but I've changed a lot about it since then, it's been a learning experience with an insane amount
of yak shaving.
The state of it is still kind of rough, the configuration is still just a massive toml file which isn't especially forgiving.
On top of that, because of my self-imposed constraints, fonts have to be specified by path. Meaning I'm shipping a default
config that will almost definitely crash on your machine until you edit in your font paths.
Furthermore, running a no_std binary without linking startfiles means I had to use naked functions
and because I'm using an allocator I need default_alloc_error_handler luckily both are nearing stabilization.
When that's fixed and a few minor bugs, it might be time for a 1.0 and I'll make another post.
Maybe I'll have made an even weirder change in the back-end functionality by then.
Some highlights:
- Rewrote the
xcbinterfacing library with codegen
(really stupid, took an insane amount of time, 0/10 would not repeat) - Wrote a tiny
no_stdno libc (optional no alloc) partial std-lib for Linux (x86_64and most stuff in there also working
foraarch64) - Migrated the wm to be
no_stdwith no libc.
Why
I was thinking about specializing x11rb which is a great library for interfacing
with X11,
to my specific single threaded use case.
At some point I realized that I could try to make the WM entirely no_std and then, entirely without libc which was a
really fun challenge.
Tiny-std
There are a lot of cool things to find when digging into the Linux APIs, glibc and musl source. I learned a lot
in the process and wrote about
that at some length here.
All in all the binary becomes a lot smaller, most things are same-y in speed, but I did, after finding out how to parse
the vDSO
at runtime, manage to beat the standard library's Instant::now() by getting the current time in a bit less than 12% of
the time, seeing that was really cool.
If you want to check out the WM, that can be found here.
If you want to check out tiny-std,
that's here.
As previously mentioned, there's a write-up on all of that here.
Up next
Thinking about some minimal terminal emulator using tiny-std, optimized for input-latency, if I get the time.