news
Programming Leftovers
-
GCC ☛ Algol 68 GCC Front-End
This is a GCC front-end for Algol 68, the fascinating, generally poorly understood and often vilified programming language. It is common knowledge that Algol 68 was well ahead of its time back when it was introduced, and anyone who knows the language well will suspect this probably still holds true today, but more than fifty years after the publication of the Revised Report the world may finally be ready for it, or perhaps not, we shall see ;) At the very least having support in GCC will make it easier for Algol 68 enthusiasts to write, share and use their programs in modern systems.
-
Dirk Eddelbuettel ☛ Dirk Eddelbuettel: RcppSpdlog 0.0.23 on CRAN: New Upstream
Version 0.0.23 of RcppSpdlog arrived on CRAN today (after a slight delay) and has been uploaded to Debian. RcppSpdlog
This release updates the code to the version 1.16.0 of spdlog which was released yesterday morning, and includes version 1.12.0 of fmt.
-
Nicolas Fränkel ☛ On dependencies in objects
In OOP, objects collaborate. The initial idea of collaboration, first found in Smalltalk, was for object A to send a message to object B. Languages designed later use method calling. In both cases, the same question stands: how does an object reference other objects to reach the desired results?
In this post, I tackle the problem of passing dependencies to an object. I will go through several options and analyze their respective pros and cons.
-
Python
-
Anže Pečar ☛ Django bulk_update memory issue
Recently, I had to write a Django migration to update hundreds of thousands of database objects. With some paper-napkin math I calculated that I can fit all the necessary data in memory, making the migration much simpler than it would have been otherwise.
-
Beej ☛ Using Virtual Environments in Python
Hi! This is an anti-slop blog that just presents some simple information without ads and a tremendous backstory about how my grandfather used Python back in the day or whatever. (He used FORTRAN and punch cards, for the record, but already I digress.)
And here I'm using the Zsh shell, but a generally-compatible one like Bourne or Bash will work. Check out the official instructions for other shells or tons more detail on this topic.
Let's go!
-
Mikael Zayenz Lagerkvist ☛ How to check for overlapping intervals
Working with intervals is a common task in programming, whether you’re dealing with time ranges, scheduling problems, or geometric computations. A key insight when working with intervals is that checking for the absence of an overlap is often much simpler than checking for all the ways an overlap can occur.
This post will first cover how to represent intervals in code, then dive into the logic for detecting overlaps.
-
-
Standards/Consortia
-
[Old] Dochia ☛ JSON is not JSON Across Languages
JSON (JavaScript Object Notation) was designed as a simple, lightweight, and human-readable data interchange format, often positioned as a more accessible alternative to XML. It has become the de facto standard for web APIs and system integration. However, while the specification itself is straightforward, different programming languages and libraries can interpret certain aspects of JSON differently. What appears to be a uniform format can, in practice, lead to subtle inconsistencies, edge cases, and implementation details that developers need to be aware of when working across diverse platforms.
It turns out JSON isn’t quite as universal in practice as the spec would suggest. Who knew?
-
Ruud van Asseldonk ☛ Abstraction, not syntax
The world is growing tired of yaml. Alternative configuration formats are making the rounds. Toml has steadily been gaining traction, in part due to tools like Cargo and adoption in the Python standard library. Json supersets (with comments, commas, and the digit 5) are flourishing, while KDL, kson and now maml promise to hit the sweet spot between friendly and simple.
While I do believe that yaml is harmful, all of the simpler formats are basically fine, and their differences are mostly superficial. The one real difference is in their data models. Most formats adopt the json data model of objects and arrays, while KDL, HCL, and e.g. Nginx adopt the XML data model of named nodes with attributes and children. The rest is just syntax. And yes, syntax does matter, but line noise is not the real problem here!
-
Ruben Schade ☛ 64-bit PCI versus PCI-X
I learned something new today. I long assumed the ubiquitous 32-bit PCI slot was “PCI”, and that the longer PCI slot was therefore “PCI-X”. This isn’t true at all; they’re different standards.
I had a Power Mac G5 back in the day, and I now have a Blue and White G3 and a QuickSilver G4, all of which feature wider PCI slots. But these aren’t equivalent. I was able to coast on a misapprehension my entire life because the slots are backwards compatible. Welp!
-