news
Programming Leftovers
-
Wouter Groeneveld ☛ Getting Emacs And MacOS To Play Nice
What a nightmare. Yet another reason (previously the never-ending flow of bloat) to switch back from MacOS to a proper *Nix environment. I thought installing an old editor would be as simple as issuing a single “fetch me that package, will you” command. But I was so very wrong.
Expect more of these “Emacs Journey” posts in-between the regular ones. Apologies if they’re completely useless to you: I need to have this on record.
-
Logging Sucks ☛ Logging Sucks - Your Logs Are Lying To You
Logs were designed for a different era. An era of monoliths, single servers, and problems you could reproduce locally. Today, a single user request might touch 15 services, 3 databases, 2 caches, and a message queue. Your logs are still acting like it's 2005.
Here's what a typical logging setup looks like: [...]
-
Ed Kellett ☛ Inverse parentheses
Have you ever noticed that lots of programming languages let you use parentheses to group operands, but none use them to ungroup them? No? Well let’s pretend this is a normal thing to be thinking about, and see what we can do about it.
Grouping with parentheses is relatively easy to add to a language grammar. The rule that accepts atomic things like 37 simply needs to also accept an opening paren, at which point it will recursively parse an entire expression, and then eat a closing paren.
-
[Old] Jesper Cockx ☛ Jesper Cockx - Functional Programming in the Netherlands
Back in January of this year, I had the honor of hosting the `FP Dag’ – also known as the Dutch Functional Programming Day – here in Delft. Apart from several entertaining and thought-provoking talks, we also had a discussion around functional programming in education. During this discussion, I gathered input from the participants on four questions: [...]
-
JYN ☛ i'm just having fun
all the things i know i learned by experimenting with them, or by reading books or posts or man pages or really obscure error messages. sometimes there's a trick to it but sometimes it's just hard work. i am not magic. you can learn these things too.
everyone has their own area of specialization
-
Perl / Raku
-
Rakulang ☛ Day 18 – Hallo, Wêreld! – Raku Advent Calendar
When writing to Santa, it doesn’t matter which language you write your wishlist in — for Santa is learning all the languages he can: [...]
-
Rakulang ☛ Day 19 – Welcome to the Megadungeon – Raku Advent Calendar
I’d like to take this opportunity to explore a new spin on all of this. If Perl 1-4 represents the Hobbit, then Perl 5 (now, at-last-and-once-again known as simply Perl) is the Lord of the Rings. Perl has certainly gone to Mount Doom and back. And when it finally arrived back home, it found that its position in the world had been irrevocably changed.
That is also to say that Perl represents an achievement of similar scope and magnitude as to Tolkien’s genre-defining series. Nothing that came after it ever looked or felt quite the same. But none would ever again dare to arrive without (hash)maps in place!
-
Rakulang ☛ Day 20 – We’re Walking On The Air – Raku Advent Calendar
Here’s where we left off – with a complete single page website: [...]
-
Rakulang ☛ Day 21 – A Terminal’s Tale – Raku Advent Calendar
The original task is simple. Show the output of some program in a sub frame of a TUI application. (TUI == Text User Interface, i.e. apps like tmux, vim, k9s) For those that wonder, there is a yet to be finished TUI debugger application I’m working on, the child program is the thing to debug, the TUI debugger should put the child’s output in a frame.
So without knowing what I was getting into, I tried the obvious and retrieved the program output via Proc::Async. This looks something like this: [...]
-
-
Python
-
Python ☛ What’s new in Python 3.15 — Python 3.15.0a3 documentation
This article explains the new features in Python 3.15, compared to 3.14.
For full details, see the changelog.
-
[Old] Artem Golubin ☛ Tracking malicious code execution in Python
Usually, malicious packages attempt to imitate a legitimate library so that the main code works as expected. The malicious part is usually inserted into one of the files of the library and executed on import silently.
If the actor lacks experience, he will likely not obfuscate his code at all. Experienced actors usually obfuscate their code or try to avoid simple heuristics such as regexes. Regexes are fragile and can be fooled by using simple tricks, but it's not possible to know them in advance.
One of the problems is that the harder you obfuscate the code, the easier it can be detected. So, actors try to balance things.
In this article, let's see how calls to eval or exec can be obfuscated and abused.
-
-
Java/Golang
-
Andrew Healey ☛ A Fair, Cancelable Semaphore in Go
They say that you don't fully understand something unless you can build it from scratch. To wit, my challenge to the more technical readers of this blog is: can you build a semaphore from scratch in your favorite programming language? Bonus points for also handling context cancellation.
-
Artem Golubin ☛ Hash tables in Go and advantage of self-hosted compilers
Recently, I was looking at the Go codebase that was using map[int]bool to track unique values. As some of you may know, Go has no set data structure. Instead, developers usually use hash maps (key-value data structure).
-
[Old] George Robinson ☛ How capacity hints work in Go
Today we will look at what capacity hints are in Go and how they work for slices and maps. We will see that when creating slices the Go runtime always allocates the requested capacity. However when creating maps the Go runtime uses lazy allocation for small hints, and allocates more capacity than hinted for large hints. Hopefully by the end of this page you will have a much better understanding of how both slices and maps work internally and how their memory is allocated and resized by the Go runtime.
-