Programming Leftovers
-
Metaprogramming in Zig and parsing CSS
I knew Zig supported some sort of reflection on types. But I had been confused about how to use it. What's the difference between @typeInfo and @TypeOf? I ignored this aspect of Zig until a problem came up at work where reflection made sense.
The situation was parsing and storing parsed fields in a struct. Each field name that is parsed should match up to a struct field.
-
Merge Queues
A CI workflow starts when a developer pushes a proposed change (pull request, changeset, patch, etc.). The code goes through a cycle of reviews and testing until it passes automated and manual (i.e., review) tests. Then it gets merged into the main branch.
But it’s not that simple, and there are numerous places where this can go wrong (and ways to make it more efficient).
-
Failing to draw lines between 'script' and 'program'
I'm not sure I fully believe what I posted any more, or even that I can clearly draw a distinction between 'script' and 'program' that feels right and is useful in practice. Personally, I think that all compiled things are programs, not scripts, and I probably call all of my Python code, even small ones, a 'program'. Is Linux's DKMS, famously written as several thousand lines of Bourne shell, a 'program' or a 'script'? I don't know. I've probably called it both at various times, but then some of the times I've called it a script I've probably meant that as short for 'a Bourne shell script', ie I was talking about the implementation language.
-
Port LLVM XRay to Apple systems
I do not use Apple products, but I sometimes like investigating Mach-O as an object file format and my llvm-project changes sometimes need to work around the quirks.
LLVM has a function call tracing system called XRay. It supports many architectures on Linux and some BSDs but does not support Apple systems. If the target triple is x86_64-apple-darwin*, you may notice that Clang will allow you to perform compilation, but linking will fail. For other architectures, Clang will reject it.
-
Raspberry Pi Tracks Flights and Weather in One Convenient Project
In this project, C0wsaysmoo is using a Raspberry Pi 3 A+ but there’s no reason you couldn’t use something smaller like a Raspberry Pi Zero or even bigger like the latest Raspberry Pi 4. It’s connected to a 64 x 32px RGB matrix panel that’s controlled using an Adafruit Bonnet. Everything is housed inside of a wooden box and finished with a tinted acrylic cover in front of the screen.
-
The Servo Blog: Conference news
In the first week of June 2023, the Servo project team participated in the Web Engines Hackfest 2023. Delan Azabani gave a talk about the Servo project, diving into the details of the team’s work in the first half of the year and its plans for the second half. The talk provided some valuable insights into running some Servo demos as well as the status of floats and the evolution of the layout system. In addition, there were some engaging discussions around the future of the shared style crate in Gecko and Servo.
-
Arthur Grillo: How it’s Going: Adding NV12 support to VKMS
This work proposed by my mentor Maíra Canal is going more difficult than I thought >W<.
On the Community Bonding Period of GSoC, Maíra proposed I work on VKMS. While looking on the TODO list of the driver, on the plane feature section, I found the item “Additional buffer formats, especially YUV formats for video like NV12” interesting to work on, as it has some correlation with my work on the GSoC.
-
Vasudev Kamath: Notes: Experimenting with ZRAM and Memory Over commit
Introduction
The ZRAM module in the Linux kernel creates a memory-backed block device that stores its content in a compressed format. It offers users the choice of compression algorithms such as lz4, zstd, or lzo. These algorithms differ in compression ratio and speed, with zstd providing the best compression but being slower, while lz4 offers higher speed but lower compression.
Using ZRAM as Swap
One interesting use case for ZRAM is utilizing it as swap space in the system. There are two utilities available for configuring ZRAM as swap: zram-tools and systemd-zram-generator. However, Debian Bullseye lacks systemd-zram-generator, making zram-tools the only option for Bullseye users. While it's possible to use systemd-zram-generator by self-compiling or via cargo, I preferred using tools available in the distribution repository due to my restricted environment.
-
Python's nonstandard JSON encoding
Python’s built-in JSON module, json, can produce results that most other JSON parsers do not accept. This is because it has nonstandard serializations for infinity, negative infinity, and NaN.
-
Java Volatiles
In Java and other JVM languages, “volatile” reads and writes are part of the concurrency toolbox. But adding volatile on variables can be a mistake. This is a poorly understood concept. Let’s gain a better understanding.