Programming Leftovers
-
Sean Conner ☛ Artisanal code to solve an issue only I have
The code just loops, reading lines from the server and then sending them directly to the syslog daemon. Any errors (like the IP address got reassigned so the connection drops) the loop ends, we close the connection and return, falling into the retry loop in the connect() function.
In case anyone is interested, here's the source code for the server and the client.
-
Sean Conner ☛ Concurrency is tricky
The core of the routine, the nested function main() does the real work here. When main() starts, the flag for queue readiness is false. It then runs through its input queue sending data to the client. Once that is done, it sets the queue readiness flag to true and then yields. Once it resumes, it sets the queue readiness flag to 'false' and (through a tail call) starts over again.
This ensures that logs are queued properly for delivery, and running the C test program again showed it works.
-
Ruben Schade ☛ Being goal oriented, not process oriented
I’m tempted to print that last line on the back of a business card.
-
Max Bernstein ☛ A compiler IR for Scrapscript
I wrote previously about different slices of life in the various implementations of the Scrapscript programming language. Until two weeks ago, the most interesting implementation was a so-called “baseline compiler” directly from the AST to C. Now we have an intermediate representation—an IR.
-
Chris Done ☛ Less-Than Estimation
I call it “less than estimation” because if a given piece of work is obviously under an hour, your estimate is <hour>. If it’s not obvious, you bump it up to <day>. If it doesn’t obviously fit within a day, bump it up to a <week>. If you’re not sure it’ll fit into a week, my experience says that it could take even three weeks, so bump it up to <month>.
-
Bernat Ràfales ☛ A caveat with statically linked language runtimes
Most programming languages, including C and C++, provide language runtime libraries that implement parts of the language itself. These libraries must be linked in the final program or shared library.
Today we are going to see how an unfortunate default in the way shared libraries work in Linux can make our lives a bit more complicated than they have to if the language runtimes are in static libraries.
-
The New Stack ☛ 3 Key Benefits of Platform Engineering
A look at the role of platform engineering, its principles and benefits for teams striving for scalable, efficient and innovative development practices.
-
Alex Petros ☛ Why Insist on a Word
REST is a widely misunderstood term, and if you point that out to people, you will be told, repeatedly and sometimes quite irately: who cares? REST has a new meaning now—use words the way people understand them and spare us the lecture.
That criticism is compelling—who among us isn’t a little descriptivist at heart—but sometimes the original, more precise meaning of a word is necessary to communicate something that the more common meaning can’t capture. To move hypertext forward, we have to build on the best work of our predecessors in the field, and that’s impossible to do without engaging with what they said and how they said it.
So here’s what REST is, and why it matters that we call it that.
-
Armin Ronacher ☛ Fat Rand: How Many Lines Do You Need To Generate A Random Number?
As the name implies, the rand crate is capable of calculating random numbers. The crate itself has seen a fair bit of churn: for instance 0.9 broke backwards compatibility with 0.8. So, as someone who used that crate, I did what a responsible developer is supposed to do, and upgraded the dependency. After all, I don't want to be the reason there are two versions of rand in the dependency tree. After the upgrade, I was surprised how fat that dependency tree has become over the last nine months.
-
[Repeat] Rlang ☛ Key considerations for retiring/superseding an R package
In this post, I want to share some considerations and lessons learned from maintaining {bpmodels}, originally developed by Sebastian Funk at the London School of Hygiene & Tropical Medicine (with contributions by Zhian Kamvar and Flavio Finger), and the decision to retire/supersede it with {epichains}. The aim is not to define strict rules but to spark a conversation about good enough practices and alternative approaches that the R developer community has used or would like to be used more widely.
-
Perl / Raku
-
[Repeat] Perl ☛ What's new on CPAN - December 2024
Welcome to “What’s new on CPAN”, a curated look at last month’s new CPAN uploads for your reading and programming pleasure. Enjoy!
-
[Repeat] Rakulang ☛ 2025.05 Trixie Awaits
Thanks to the work by Timo Paulssen and many others, it looks like the next stable release of the Debian distribution (“Trixie“) will contain a recent Rakudo release! Since Debian is used as the base for a number of other Linux distributions, this is extra good news for the Raku Programming Language in the long term!
-
-
Python
-
Valhalla's Things: Conference Talk Timeout Ring, Part One
A few ago I may have accidentally bought a ring of 12 RGB LEDs; I soldered temporary leads on it, connected it to a CircuitPython supported board and played around for a while.
-
-
Java
-
Anton Zhiyanov ☛ Go's map does not shrink
Of course, you can partially reclaim the memory by using pointers. GC will then free the deleted items, but the internal map structures will remain intact.
-