news
Programming Leftovers
-
Vikash Patel ☛ A Love Letter to the L1 Cache
Struct A was consistently 30% slower than Struct B. Struct A was also 50% larger in memory.
In high-level languages, we are taught to think of memory as a simple, uniform resource. You ask for some bytes, you get them. But when you start caring about nanoseconds, you find out that memory is not uniform at all. Getting a value from RAM takes real time, and your CPU has no choice but to sit and wait for it.
This post is about that wait.
-
Andrew Nesbitt ☛ How Open Source Projects Change Hands
Dumb Ways for an Open Source Project to Die listed the ways projects end up dead, and most of the entries describe a moment where maintainership should have moved to someone else and didn’t. This is the other, shorter inventory: the mechanisms that exist for a project to change hands, and who can trigger each one.
-
The New Stack ☛ Code is a message to the future
Code is not only a set of instructions for a machine. It’s a message to the next engineer who has to read, extend, or debug it. It’s a message to your teammates in review. It’s a message to yourself six months from now, when all the original context is gone. A commit message is a Slack message that has to stand on its own. No thread. No way to ask a follow-up question. Often read years after it was written.
Once you treat code as communication, the questions you should ask yourself change. Is this commit understandable on its own? Can someone review this PR in order? Does this comment explain why the code exists, or does it just repeat what the code already says?
-
Dirk Eddelbuettel ☛ Dirk Eddelbuettel: rspdlite 0.1.0-1 on CRAN: New Package!
Very happy to share that a new package rspdlite arrived on CRAN today in its inaugural version 0.1.0-1. It wraps and provides the (header-only) C++20 library spdlite which its author describes (aptly) as tiny, fast, capable. Just like its bigger sibbling spdlog (which we wrapped as rcppspdlog), it is written by Gabi Melman.
-
Adam Young: Downloading from gitlab
We use gitlab to post internal releases of archives. I want to be able to automate the process of downloading these artifacts. Here it is using the glab CLI.
-
R / R-Script
-
Rlang ☛ New Package Submission Process
Bioconductor is moving towards using R-universe for its daily build system. See our previous blog post Collaborating between Bioconductor and R-universe on Development of Common Infrastructure. As we move in this direction it was also necessary to update the submission process for Bioconductor packages. While the daily builders are still transitioning, the new submission process location is now live. The new system utilizes GitHub Actions to trigger review milestones and R-Universe as the build/check backend. The new system provides a smoother experience; it is more automated and avoids administrative steps that have historically bottlenecked the review process.
-
Rlang ☛ Bioconductor Maintainer Validation
Bioconductor policies include being an active and reachable maintainer. Maintainer emails in the DESCRIPTION of packages often go stale as maintainers change positions. There is also a necessity to have maintainers opt into Bioconductor policies and procedures as they change over time.
-
-
Shell/Bash/Zsh/Ksh
-
MJ Fransen ☛ Start Guile shell script that listens on a port for REPL client
Guile, while running a program, can listen to a port for a REPL client, like a Swank server on SBCL.
Here's how to connect from Geiser to a running Guile script.
-
-
Java/Golang
-
Vikash Patel ☛ Constructing Concurrent Inverted Indexes in Go | Lorbic
Building a thread-safe inverted index from scratch in Go. Covers sharded mutexes, lock contention profiling, slice pooling to avoid GC pressure, and benchmark comparisons against a naive sync.RWMutex approach under varying read/write ratios.
-
Tim Bray ☛ Automata, Built For Comfort or Speed
Since it’s been so long, here’s what Quamina, a Go-language library, does: You can add “Patterns” to a Quamina instance, they match the values of fields in JSON objects, and then you show Quamina a JSON “Event” and it’ll tell you which Patterns matched it. It’s pleasingly fast and in many cases the speed is not strongly affected by the number of Patterns you’re trying to match.
-
Kevin McDonald ☛ The Hidden Cost of google.protobuf.Value
Migrating legacy JSON APIs to gRPC frequently stumbles over a common anti-pattern: unstructured, dynamic JSON fields (such as metadata or extra_properties) mapped directly into Protobuf using google.protobuf.Value or google.protobuf.Struct.
These belong to Protobuf’s Well-Known Types (WKTs), a library of standardized, common message schemas defined by Google (such as Timestamp, Duration, and Any) that ship out-of-the-box with the Protobuf compiler to provide consistent representation for reusable data structures across different languages.
But what actually are these specific dynamic types under the hood, and how are they used?
-