news
Programming Leftovers
-
Josh Lospinoso ☛ The Function Signature Is a Lie
On common 64-bit targets, if struct Big is large enough to be returned indirectly, the caller allocates storage for the result and passes a pointer to that storage into the callee. That pointer is not in your source signature. It is not the seed. It is not a local variable you named. But at the ABI level, it may be the first thing the callee receives.
For this deliberately large example: [...]
-
Qt ☛ Introducing Agentic Test Generation Skills for Qt Quick
Writing unit tests can be one of the most time-consuming and least creative phases of software development. For every QML component a developer writes, an equivalent volume of test code must follow - covering properties, signals, mouse and key interactions, state transitions, and edge cases.
-
Dmitrii Kovanikov ☛ Using a 50-years old technique for solving modern issues
While implementing Haskell functions with deeply nested logic, I’ve discovered a particular trick that allows writing more modular code by solving annoying indentation errors at the same time.
The described technique uses the CPS transformation and Haskell layout parsing rules. It sounds scary but in its core it’s just a refactoring using Higher-Order Functions, no fancy features involved.
-
Python
-
Noë Flatreaud ☛ Real-time notifications with Flask and SSE
Server-Sent Events (SSE) offer a straightforward way to push real-time updates from a server to a client. Unlike WebSockets, SSE is designed one-way ony, from the server to the client which makes it an excellent choice for applications that need to send notifications, updates, or messages to clients without full-duplex connections. In this post, we'll try and implement SSE using Python. Hope you'll find this relevant.
-
Bernát Gábor ☛ Deterministic Multithreaded Testing in Python with blanket
The problem : testing multithreaded code is hard because the OS scheduler decides which thread runs when, making race conditions nearly impossible to reproduce in a test suite. The solution : blanket wraps real threading primitives (Lock, Condition, Event, Barrier, Semaphore) and lets your test act as the scheduler, controlling which thread proceeds at each step.
-
University of Toronto ☛ Using typing in Python leads to different sorts of code
So what happened is that I converted a big pile of (highly untyped) Python 2 to Python 3 recently, and then I wanted to experiment with typing-heavy Python LSP servers in GNU Emacs, so I decided to try them out by experimentally adding some type annotations to DWiki, the aforementioned pile of untyped Python (and the code powering Wandering Thoughts). The experience was educational and taught me some new things about type annotations, but it also firmed up my view that typed Python code is different than untyped Python code (although not quite to the extent that they create a different language, as I sort of felt before). There are idioms that are perfectly natural in untyped Python that are pretty annoying to deal with in typed Python.
-
-
Shell/Bash/Zsh/Ksh
-
Rlang ☛ Ghost in the Shell Script
I’ve been using Unix and GNU/Linux systems for nearly 20 years. When I found myself with a backdoored Windows laptop for a while I felt lost and quickly installed backdoored Windows Subsystem for Linux.
-
-
Rust
-
Rust Weekly Updates ☛ This Week In Rust: This Week in Rust 653
Hello and welcome to another issue of This Week in Rust!
-
Rust Blog ☛ The Rust Programming Language Blog: Announcing Rust 1.96.0
The Rust team is happy to announce a new version of Rust, 1.96.0. Rust is a programming language empowering everyone to build reliable and efficient software.
-
LWN ☛ Rust 1.96.0 released
Version
1.96.0 of the Rust programming language has been released. Changes
include a new set of Copy-implementing Range types,
assertions with pattern matching, a number of stabilized APIs, and two
Cargo vulnerability fixes.
-
-
Packagers
-
Andrew Nesbitt ☛ Package managers that package package managers
The dense rows are the system package managers, and packaging arbitrary binaries is what they’re for. The AUR carries 40 of the 42, with nixpkgs, Homebrew, the DNF repos and Debian not far behind. The same tools are almost empty as columns, because nothing needs to redistribute apt or DNF when they already arrive with the operating system. Homebrew is the slightly odd case among the system managers since it isn’t tied to an operating system image, and the only place I found it packaged is the AUR, where someone has wrapped the install script as brew-git.
-
Aurélien Gâteau ☛ Clyde 0.10.0 released | agateau.com
Sorry for the dad joke, Clyde cool down is not about keeping you fresh but rather about not installing hot new rogue package releases. As I explained in my previous post about Clyde, cool down is a security protection to mitigate supply chain attacks: it imposes a delay between the moment a package has been published and when it can be installed, leaving time for security researchers to detect rogue releases. The hope is that by the time the cool down delay has passed, any rogue release has been detected and taken down so it can no longer be downloaded.
It's not a perfect solution, but it's another layer of security. Since Clyde installs binary packages published directly by their authors without any rebuild step, it's good to at least have this cool down feature as a minimum barrier.
-