news
Programming Leftovers
-
Hans Wennborg ☛ Big-Endian Testing with QEMU
When programming, it is still important to write code that runs correctly on systems with either byte order (see for example The byte order fallacy). But without access to a big-endian machine, how does one test it? QEMU provides a convenient solution. With its user mode emulation we can easily run a binary on an emulated big-endian system, and we can use GCC to cross-compile to that system.
-
CSS Tricks ☛ JavaScript for Everyone: Destructuring
Now, sooner or later, you do run into the catch: nobody is born thinking like JavaScript, but to get really good at JavaScript, you will need to learn how. In order to know why JavaScript works the way it does, why sometimes things that feel like they should work don’t, and why things that feel like they shouldn’t work sometimes do, you need to go one step beyond the code you’re writing or even the result of running it — you need to get inside JavaScript’s head. You need to learn to interact with the language on its own terms.
-
SusamPal ☛ Fork Commits via Original Repository
I ran a small experiment with Git hosting behaviour using two demo repositories: [...]
-
J Kenneth King ☛ Agentultra - Why Array Arguments Decay To Pointers In C
But you would soon discover that your assumptions won’t work and your code has some weird errors in it that you don’t understand. This is because array arguments in C decay into a pointer to the first element of the array. This post gets into what that means, why it works that way, and how to write code that avoids problems.
-
Jeanine Adkisson ☛ how to make programming terrible for everyone | jneens web site
In some sense, which I hope to make a bit more concrete here, Python and your favourite programming language have more respect for the interaction between the user and the computer, allowing each to do what they do best. Every modern high-level language is built on a mountain of abstractions, but to some extent they actually free you from thinking about it most of the time, allowing you to work with simplified mental models that make the act of programming easier, clearer, and more fun.
So, how do we do better than the Quine Programmer? How can we connect the dots between human user and computer in a way that respects the strengths of both?
-
Python
-
Juha-Matti Santala ☛ I’m building a Python script to create form filling bookmarklets
Until now, I’ve been doing them by hand but this week I wanted to explore this problem space a bit more. I figured a nicer interface would be to have a spec file (in my case, written in YAML) where I could define all my fields and values and then run a script to generate the bookmarklet.
I wrote the first version of form-filler to satisfy my own needs. It’s an open source Python script and if you’re interested in simplifying a rather boring aspect of your web dev work, check it out.
-
Henry Schreiner ☛ Working to make Python lazy -
Python 3.15a7, which is now just a uv python install 3.15 away on all major platforms, has lazy imports! This exciting feature, proposed in PEP 810, promises to make CLI applications faster (especially when using flags like --help), and could make a lot of large code with lots of imports that don’t always get used faster too. Unlike the earlier, failed attempt, this requires libraries to put in some work. I’ve developed a helper tool to make it easy; I’d like to cover what lazy imports are and how to use my tool. Since this is the first library that I used AI heavily in developing, the second half of the post will cover how my experience with AI for a task like this went.
-
-
Shell/Bash/Zsh/Ksh
-
Astrid Yu ☛ Linux is an interpreter
And once you get there, the kernel be replaced with a new one, then run /init inside /r, which happens to be this /init itself, which will replace the kernel with a new one…
… so in other words, this is a Linux distro that recursively calls kexec on itself! Isn’t that so cute?
-
-
Rust
-
Jon Seager ☛ ntpd-rs: it's about time!
ntpd-rs is a full-featured implementation of the Network Time Protocol (NTP), written entirely in Rust. Maintained by the Trifecta Tech Foundation as part of Project Pendulum, ntpd-rs places a strong focus on security, stability, and memory safety.
-