news
Programming Leftovers
-
Sean Goedecke ☛ Everything I know about good API design
If this is true about systems - and it is - it’s even more true about APIs: good APIs are boring. An API that’s interesting is a bad API (or at least it would be a better one if it were less interesting). For the developers who build them, APIs are complex products that they spend time designing and polishing. But for the developers who use them, APIs are tools that they use in order to accomplish some other goal. Any time they spend thinking about the API instead of about that goal is time wasted. From their perspective, an ideal API should be so familiar that they will more or less know how to use it before they read any documentation2.
-
Matt Blewitt ☛ Over-Engineering Sleep
The motivation of this implementation seems to be around not relying on the sleep utility, despite this being part of the POSIX standard. Instead, it uses a pure bash solution with the SECONDS bash builtin (manpage reference).
Looking at the source of bash reveals that this builtin is implemented using the gettimeofday call (assign_seconds, get_seconds). If we rely on gettimeofday anyway, why not rely on sleep?
-
MaskRay ☛ Understanding alignment - from source to object file
Alignment refers to the practice of placing data or code at memory addresses that are multiples of a specific value, typically a power of 2. This is typically done to meet the requirements of the programming language, ABI, or the underlying hardware. Misaligned memory accesses might be expensive or will cause traps on certain architectures.
This blog post explores how alignment is represented and managed as C++ code is transformed through the compilation pipeline: from source code to LLVM IR, assembly, and finally the object file. We'll focus on alignment for both variables and functions.
-
Rlang ☛ Men’s domestic chores and fertility rates – Part II, technical notes by @ellis2013nz
This post is a collection of more technical notes forming a companion piece to the previous post on men’s time spent on domestic chores and total fertility rates at the country level.
-
Rlang ☛ Replicating Hansen’s Econometrics using Armadillo
-
Rlang ☛ A Shiny app to visualize the Edgeworth box
-
Perl / Raku
-
Arne Sommer ☛ Common Find with Raku - Arne Sommer
Write a script to return all characters that is in every word in the given array including duplicates.
-
-
Python
-
Runtime Python Virtual Environment Switching based on Cantor
A long‑running backend that evaluates Python code must solve one problem well: switching the active interpreter or virtual environment at runtime without restarting the host process. A reliable solution depends on five pillars: unambiguous input semantics, reproducible version discovery, version‑aware initialization, disciplined management of process environment and sys.path, and transactional switching that can roll back safely on failure.
-
Python Virtual Environment Switching with CPython
-
-
Java/Golang
-
[Old] Thomas Habets ☛ Go is still not good
Previous posts Why Go is not my favourite language and Go programs are not portable have me critiquing Go for over a decade.
These things about Go are bugging me more and more. Mostly because they’re so unnecessary. The world knew better, and yet Go was created the way it was.
For readers of previous posts you’ll find some things repeated here. Sorry about that.
-