news
Programming Leftovers
-
Rlang ☛ Twenty Questions and Decision Trees
Most of us have probably played the game Twenty Questions. The answerer chooses something, and the other players try to guess it by asking yes or no questions. The TV show “What’s My Line” is an example of this where the players try to guess a contestant’s occupation.
Contrary to my kids’ attempts, the strategy should be to ask questions that split the remaining possibilities roughly in half each time.
This seems very similar to a machine learning Decision Tree, although with an interesting distinction.
-
Marc Brooker ☛ What Now? Handling Errors in Large Systems
The bottom line is that error handling in systems isn’t a local property. The right way to handle errors is a global property of the system, and error handling needs to be built into the system from the beginning.
-
[Old] Elias Daler ☛ Using Lua with C++ (and C)
I’ve written many articles about using Lua with C++ on my old blog many years ago. I also worked on a fork of LuaJIT professionally and described my experiences here - this experience made me learn a lot about LuaJIT and how vanilla Lua works (and how it can be used in production for servers with a very high QPS).
This is not a tutorial or step-by-step guide. It’s a road map for learning Lua and my advice for how to integrate it with C/C++ code.
-
Lawrence Tratt ☛ Automatic Syntax Error Recovery
Programming is the best antidote to arrogance I’ve come across — I make so many errors that I am continually reminded of my own fallibility. Broadly speaking, I think of errors as severe or minor. Severe errors are where I have fundamentally misunderstood something about the system I am creating. Each severe error is a bespoke problem, often requiring custom tooling to understand and fix it. Minor errors, in contrast, are repetitive and quickly fixed. However, they’re also much more numerous than severe errors: even shaving a couple of seconds off of the time it takes a programmer to fix a class of minor errors is worthwhile when you consider how often they occur.
-
Sharon Rosner ☛ OSS Friday Updat
This is where the Ruby fiber scheduler comes into the picture. Early on in my work on UringMachine, it occurred to me that the Fiber::Scheduler added to Ruby by Samuel is a perfect way to integrate such a low-level API with the Ruby I/O layer and the entire Ruby ecosystem. An implementation of Fiber::Scheduler for UringMachine would use the different scheduler hooks to punt work to the low-level UringMachine API.
-
Jose E. Marchesi: Version 6 of the Algol 68 GCC Front-End posted
Today I submitted the version 6 of the patch series for the Algol 68 GCC Front-End:
https://gcc.gnu.org/pipermail/gcc-patches/2025-November/701589.html
Since last submission we have added a modules system based on the Modules and Separate Compilation Facility designed by Charles Lindsey and Hendrik Boom and released by the IFIP Working Group 2.1 Standing Subcommittee on ALGOL 68 Support. To our knowledge, this is the first time the modules facility ever gets implemented. -
Dirk Eddelbuettel ☛ Dirk Eddelbuettel: RcppArmadillo 15.2.2-1 on CRAN: Upstream Update, OpenMP Updates
widely used by (currently) 1286 other packages on CRAN, downloaded 42.6 million / vignette) by Conrad and myself has been cited 659 times according
This versions updates to the 15.2.2 upstream Armadillo release made two days ago. It brings a few changes over the RcppArmadillo 15.2.0 release made only to Microsoft's proprietary prison GitHub (and described in this post), and of course even more changes relative to the last CRAN release described in this earlier post. As described previously, and due to both the upstream transition to C++14 coupled with the CRAN move away from C++11, the package offers a transition by allowing packages to remain with the older, pre-15.0.0 ‘legacy’ Armadillo yet offering the current version as the default. During the transition we did not make any releases to CRAN allowing both the upload cadence to settle back to the desired ‘about six in six months’ that the CRAN Policy asks for, and for packages to adjust to any potential changes. Most affected packages have done so (as can be seen in the Microsoft's proprietary prison GitHub issues #489 and #491) which is good to see. We appreciate all the work done by the respective package maintainers. A number of packages are still under a (now formally expired) deadline at CRAN and may get removed. Our offer to help where we can still stands, so please get in touch if we can be of assistance. As a reminder, the meta-issue #475 regroups all the resources for the transition.
With respect to changes in the package, we once more overhauled the OpenMP detection and setup, following the approach take by package
data.tablebut sticking with anautoconf-basedconfigure. The detailed changes since the last CRAN release follow. -
Perl / Raku
-
Arne Sommer ☛ Time Alike with Raku
You are given a string of even length.
Write a script to find out whether the given string can be split into two halves of equal lengths, each with the same non-zero number of vowels.
-
-
Python
-
Jon Chiappetta: Secure VPN DNS Service – Forwarding/Proxying/Caching/Ciphering – Python
Since I am running a network-wide VPN tunnel on behalf of the clients on the network, any plaintext UDP based DNS packets would be protected from your ISP seeing them, however, the VPN servers ISP would still be able to see them all. I decided to write a new Python DNS server which will listen on the VPN client side and redirect all plaintext UDP DNS traffic to it locally instead.
-
Andreas Zwinkau ☛ Python Distributions for Bazel
Does it have to be that way? What if you have Python tools with conflicting dependencies? There should be a way to build Python environments with Bazel. Multiple environments.
-
University of Toronto ☛ You can't (easily) ignore errors in Python
As every Python programmer knows, errors raise exceptions in Python and you can catch those exceptions, either narrowly or (very) broadly (possibly by accident). If you don't handle an exception, it bubbles up and terminates your program (which is nice if that's what you want and does mean that errors can't be casually ignored). On the surface it seems like you can ignore errors by simply surrounding all of your code with a try:/except: block that catches everything. But if you do this, you're not ignoring errors in the same way as you do in a language where errors are return values. In a language where you can genuinely ignore errors, all of your code keeps on running when errors happen. But in Python, if you put a broad try block around your code, your code stops executing at the first exception that gets raised, rather than continuing on to the other code within the try block.
-
-
Java/Golang
-
[Old] Gunnar Morling ☛ Let's Take a Look at... Lower Java Tail Latencies With ZGC - Gunnar Morling
The high-level intuition on concurrent garbage collectors (another example being Shenandoah) is that they move as much of their work as possible from the application’s threads to separate GC threads. That way, they essentially do away with GC pauses, which used to plague Java users in the past in the form of high tail latencies of their applications. ZGC pushes down GC times in application threads down to the sub millisecond range, making GC pauses practically a non-issue for the vast majority of use cases. Of course, there is no free lunch: by running the GC logic in separate threads, concurrent collectors require more CPU resources, thus reducing the overall throughput of the system.
-