Programming Leftovers
-
Mark-Jason Dominus ☛ A complex bug with a ⸢simple⸣ fix
Last month I did a fairly complex piece of systems programming that worked surprisingly well. But it had one big bug that took me a day to track down.
One reason I find the bug interesting is that it exemplifies the sort of challenges that come up in systems programming. The essence of systems programming is that your program is dealing with the state of a complex world, with many independent agents it can't control, all changing things around. Often one can write a program that puts down a wrench and then picks it up again without looking. In systems programming, the program may have to be prepared for the possibility that someone else has come along and moved the wrench.
The other reason the bug is interesting is that although it was a big bug, fixing it required only a tiny change. I often struggle to communicate to nonprogrammers just how finicky and fussy programming is. Nonprogrammers, even people who have taken a programming class or two, are used to being harassed by crappy UIs (or by the compiler) about missing punctuation marks and trivially malformed inputs, and they think they understand how fussy programming is. But they usually do not. The issue is much deeper, and I think this is a great example that will help communicate the point.
-
[Old] Dmitrii Kovanikov ☛ Pragmatic Category Theory | Part 1: Semigroup Intro
I’ve been using pure FP in production for 10 years. I programmed in Haskell, OCaml, Elm and PureScript. I’ve solved real-world problems in diverse industries, such as healthcare, dating, fintech and blockchain.
In my short (but eventful) career, I benefited a lot from foundational abstractions that took root in abstract algebra and category theory. I experienced first-hand the value of these concepts. This is good stuff, folks!
I want to demystify these concepts.
-
[Old] Dmitrii Kovanikov ☛ Pragmatic Category Theory | Part 2: Composing Semigroups
You’ll notice the following Functional Programming pattern many times:
1. You define trivial fundamental blocks.
2. You define trivial ways to compose blocks.
3. Suddenly, you end up with something extremely powerful.I don’t know how it works but it works every time. Trust the process.
Thus, it’s important to develop the skill of noticing a particular pattern in diverse situations. We need to pump that Tetris Effect of yours.
-
[Old] Dmitrii Kovanikov ☛ Pragmatic Category Theory | Part 3: Associativity
We’ve looked mostly on trivial semigroup examples but before exploring more advanced and real-life use cases, I’d like to spend more time on exploring why associativity matters.
We’ll see how this single concept enables:
1. Correctness
2. Extensibility
3. Performance -
Concurrency Freaks ☛ Concurrency Freaks: Can Transactions and Coroutines co-exist?
The other day, I was daydreaming about what the "perfect language" for concurrency would look like, and one of the design options I was considering, was how useful were coroutines, and can they coexist with transactions?
Spoiler alert: the answer is an almost certainly no.
There is usefulness in the transactional model and in the coroutine model. Transactions are a nice way to solve problems which need to share data across different execution contexts, while coroutines are a way to reduce latency for problems which are naturally asynchronous, and perhaps a way to increase scalability for fully disjoint-access-parallel problems, such as sessions on a web server, though I would argue this scalability stems from the "task" where the coroutine runs, and not the usage of the coroutines by themselves.
-
Python
-
Kushal Das: Dealing with egl_bad_alloc error for webkit
I was trying out some Toga examples, and for the webview I kept getting the following error and a blank screen.
Could not create EGL surfaceless context: EGL_BAD_ALLOC.
After many hours of searching I reduced the reproducer to a simple Python Gtk code.
-
[Old] Serghei Iakovlev ☛ Advanced Python Development Workflow in Emacs
Emacs is not just an editor — it’s an extensible platform for crafting highly personalized development environments. With tools like company, yasnippet, lsp-mode and dap-mode, Emacs transforms into a feature-rich Python IDE capable of competing with PyCharm or VS Code.
This guide explores how to evolve Emacs into a robust Python IDE. Whether you’re writing simple scripts or managing large-scale projects, you’ll find a setup that aligns with your engineering needs and reflects the power of Emacs customization.
-
-
Java
-
Security Week ☛ Google Releases Open Source Library for Software Composition Analysis
Released as an open source Go library, the tool is an extensible file system scanner designed to extract information on software inventory and identify vulnerabilities.
OSV-SCALIBR can either be used as a standalone binary (a wrapper around the library), or can be imported into Go projects as a library.
-