news
Programming Leftovers
-
Den Odell ☛ Constraints and the Lost Art of Optimization
In 1984, Steve Jobs walked over to a bag standing on stage and pulled out a computer that would change the world. The Macintosh had an operating system, a graphical user interface, window manager, font renderer, and a complete graphics engine called QuickDraw, one of the most elegant pieces of software ever written.
The whole thing fit inside the machine’s 64KB ROM. Sixty. Four. Kilobytes.
-
Connor Tumbleson ☛ Apktool v3.0.0 Released
So knowing Igor had been giving pull requests to Apktool for years it was an easy ask to grant him access to the repository with a maintainer role. So Igor helped majorly in designing and stabilizing Apktool v3 as well as reviewing support issues and feedback. As I hacked it to pieces over the past decade fixing crashes here and there it was great to have someone review the code as a whole and iterate with a design in their mind.
-
Andrew Nesbitt ☛ Forge-Specific Repository Folders
Git doesn’t know about CI, code review, or issue templates, but every forge that hosts git repositories has added these features through the same trick: a dot-folder in your repo root that the forge reads on push. The folder names differ, the contents overlap in some places and diverge in others, and the portability story between them is worse than you’d expect. A companion to my earlier post on git’s magic files.
-
Alex Chan ☛ The bare minimum for syncing Git repos
I have some personal Git repos that I want to sync between my devices – my dotfiles, text expansion macros, terminal colour schemes, and so on.
For a long time, I used GitHub as my sync layer – it’s free, convenient, and I was already using it – but recently I’ve been looking at alternatives. I’m trying to reduce my dependency on cloud services, especially those based in the USA, and I don’t need most of GitHub’s features. I made these repos public, in case somebody else might find them useful, but in practice I think very few people ever looked at them.
There are plenty of GitHub-lookalikes, which are variously self-hosted or hosted outside the USA, like GitLab, Gitea, or Codeberg – but like GitHub, they all have more features than I need. I just care about keeping my files in sync. Maybe I could avoid introducing another service?
As I thought about how Git works, I thought of a much simpler way – and I’m almost embarrassed by how long it took me to figure this out.
-
Lelanthran Manickum ☛ Parse, Don’t Validate AKA Some C Safety Tips
By leveraging the typing guarantees we eliminate entire classes of bugs while making the code more robust and maintainable. Instead of just checking values for correctness, we parse it once and then the compiler enforces some typing guarantees for us.
-
[Old] Thassilo Schulze ☛ Fixing C Strings
It’s well-known that null-terminated C strings are bug-prone and unsafe to use. They’re the stereotypical footgun. I’ve been tinkering in a bare-metal environment recently, writing all code myself, including the common types and routines you find in libc or similar. In all the code I wrote, there is not at single null-terminated string, and I have yet to encounter a bug related to bounds checking on strings or buffers. This is a quick rundown of what I’m doing and how it holds up.
-
Junichi Uekawa: Hey Hi (AI) generated code and its quality.
Hey Hi (AI) generated code and its quality. It's hard to get larger tasks done and smaller tasks I am faster myself. I suspect this will change soon, but as of today things are challenging. Large chunks of code that's generated by Hey Hi (AI) is hard to review and generally of not great quality.
Possibly two layers that cause quality issues. One is that the instructions aren't clear for the AI, and the misunderstanding shows; I could sometimes reverse engineer the misunderstanding, and that could be resolved in the future. The other is that probably what the Hey Hi (AI) have learnt from is from a corpus that is not fit for the purpose. Which I suspect can be improved in the future with methodology and improvements in how they obtain the corpus, or redirect the learnings, or how it distills the learnings.
I'm noting down what I think today, as the world is changing rapidly, and I am bound to see a very different scene soon.
-
Python
-
[Old] LWN ☛ A "frozen" dictionary for Python
The idea is fairly straightforward: add frozendict as a new immutable type to the language's builtins module. As Stinner put it: [...]
-
-
Shell/Bash/Zsh/Ksh
-
[Old] Greg Wooledge ☛ BashFAQ/105 - Greg's Wiki
Or, "so you think set -e is OK, huh?"
-
-
Java/Golang
-
OMG Ubuntu ☛ Ubuntu 26.04 LTS will default to OpenJDK 25
Ubuntu 26.04 LTS ‘Resolute Raccoon’ will use OpenJDK 25 as its default Java version. An expected change as OpenJDK 25 is a long-term support release, as Ubuntu 26.04 is, the bump brings various feature and performance improvements to developers over OpenJDK 21, the default version used in Ubuntu 24.04 LTS through 25.10. On Ubuntu, Java isn’t installed out of the box, but when you install default-jdk or default-jre (directly or indirectly as a dependency needed by other software) those meta-packages point to whichever OpenJDK version Canonical has blessed as current. In Ubuntu 26.04 LTS, that will be OpenJDK 25.
-
Nicolas Fränkel ☛ JVM timing options
For as long as I have been coding in Java, we have had requirements to measure the execution time of blocks of code. While the current good practice is to use OpenTelemetry’s traces, not every company has reached this stage yet. Plus, some of the alternatives are OpenTelemetry-compatible. Let’s see them in order.
-