Programming Leftovers
-
Kodsnack ☛ Kodsnack 614 - Somehow cheat the system, with David Jacoby
Recorded on-stage at Øredev 2024, Fredrik talks to IT security expert David Jacoby about his way into IT security. What was it like to get interested in computer security early on, and to try start working with it before there really was an awareness of even the need for more security information? And when did the switch happen from annoying but harmless viruses and malware to the modern information stealing and blackmailing?
-
MaskRay ☛ clang-format and single-line statements
The Google C++ Style is widely adopted by projects. It contains a brace omission guideline in Looping and branching statements:
For historical reasons, we allow one exception to the above rules: the curly braces for the controlled statement or the line breaks inside the curly braces may be omitted if as a result the entire statement appears on either a single line (in which case there is a space between the closing parenthesis and the controlled statement) or on two lines (in which case there is a line break after the closing parenthesis and there are no braces).
-
Adriaan Roselli ☛ Development Advent Calendars for 2024
I have not included advent calendars that are single blog posts, image-only efforts with inaccessible images, or delivered only via email. It would be a terrible gift from me to you if you sign up for spam or end up taking advice from organizations that are clearly bad at advice. Maybe next year I’ll ban LinkedIn posts.
-
Daniel Fedorin ☛ Implementing and Verifying "Static Program Analysis" in Agda, Part 7: Connecting Semantics and Control Flow Graphs
Our analyses operate on CFGs, but it is our semantics that actually determine how a program behaves. In order for our analyses to be able to produce correct results, we need to make sure that there isn’t a disconnect between the approximation and the truth. In the previous post, I stated the property I will use to establish the connection between the two perspectives:
"For each possible execution of a program according to its semantics, there exists a corresponding path through the graph."
By ensuring this property, we will guarantee that our Control Flow Graphs account for anything that might happen. Thus, a correct analysis built on top of the graphs will produce results that match reality.
-
University of Toronto ☛ Good union types in Go would probably need types without a zero value
One of the classical big reason to want union types in Go is so that one can implement the general pattern of an option type, in order to force people to deal explicitly with null values. Except this is not quite true on both sides. The compiler can enforce null value checks before use already, and union and option types by themselves don't fully protect you against null values. Much like people ignore error returns (and the Go compiler allows this), people can skip over that they can't extract an underlying value from their Result value and return a zero value from their 'get a result' function.
-
Chloé Vulquin ☛ Status Update: November 2024
As a consequence of catching up to some Clojure/conj talks, I discovered VSAs (Vector Symbolic Architectures). The actual talk wasn’t too interesting on its own, so I’m not going to talk about it much. Instead, I’ll just give you the interesting stuff I got to after some digging into the details. The starting point for this stuff as best as I can tell is Smolensky’s 1990 paper on tensor products. He finds a lot of interesting things to do with the mathematical processes of algebraic fields composed of a whole lot of dimensions. Importantly, one of the operations on the field ends up being a tensor multiplication. If you know what that means, you understand why no one bothered to implement them. However, it draws a really interesting parallel between VSAs and quantum mechanics (where tensor multiplication is commonly used to represent all possible interactions in quantum states). Which is exactly the kind of place this stuff ends up talked about nowadays, such as the recent-ish progress with language recognition that Kanerva participated in. There’s a lot to unpack in this field, but here’s a few more papers to read.
-
Sandor Dargo ☛ How to ensure a class is not copyable or movable
While the first two should be regular classes offering both copy and move semantics, the latter two are different. One shouldn’t be able to copy resources and singletons probably shouldn’t be moveable.
It’s up to us to ensure that a class we create implements the right special member functions (SMFs from now on). And the Hinnant table is here to guide us.
-
Rlang ☛ Advent of Code with data.table: Week One
One of my favorite traditions in the R community is the Advent of Code, a series of puzzles released at midnight EST from December 1st through 25th, to be solved through programming in the language of your choosing. I usually do a few of them each year, and once tried to do every single one at the moment it released!
-
Michael Tsai ☛ Swift Proposal: Precise Control Flags Over Compiler Warnings
This proposal suggests adding new options that will allow the behavior of warnings to be controlled based on their diagnostic group.
-
Sean Conner ☛ “Obvious” things aren't always obvious
Later I rewrote the regression test that was two steps (once you got all the credentials sorted out—thirty-five steps in the original test), and finally, about a year before I left, a third regression test that only had one step—running it—it set everything up for you.
-
Python
-
Redowan Delowar ☛ Injecting Pytest fixtures without cluttering test signatures
Sometimes, when writing tests in Pytest, I find myself using fixtures that the test function/method doesn’t directly reference. Instead, Pytest runs the fixture, and the test function implicitly leverages its side effects. For example: [...]
-