This began as a reply to another article by Lucas F. Costa; it lists
practices to improve user-experience (UX) of command-line interfaces
(CLIs). It comes from a good place, and has some good advice: I
particularly like its advice on input-validation and understandable
errors. Unfortunately, a number of its suggestions are problematic,
particularly from an accessibility perspective.
dns.toys is a DNS server that takes creative liberties with the DNS
protocol to offer handy utilities and services that are easily
accessible via the command line.
In the early evening I played a bit with DNS Toys.
In the early afternoon I finished book 4 of the Dune Chronicles by Frank
Herbert: God Emperor of
Dune. I
liked the book a little less than the previous 3. The beginning and
the ending was good but the middle part was a bit boring to me.
In this post I’ll describe how to implement caches in Rust. It is
inspired by two recent refactors I landed at nearcore
(nearcore#6549,
nearcore#6811). Based
on that experience, it seems that implementing caches wrong is
rather easy, and making a mistake there risks “spilling over”, and
spoiling the overall architecture of the application a bit.
A few years ago I've written in some
detail
about the Y combinator, including implementations in Clojure and
Python.
This short post is showing how to implement the Y combinator in Go
using generics; in general, static typing makes the Y combinator
somewhat less appealing, but I figured that generics will at least
allow the implementation to be reasonably reusable. Not that this is
useful in any real-world scenario, of course :-)
Leto Atreides, the God Emperor of Dune, is dead. In the fifteen
hundred years since his passing, the Empire has fallen into
ruin. The great Scattering saw millions abandon the crumbling
civilization and spread out beyond the reaches of known space. The
planet Arrakis—now called Rakis—has reverted to its desert climate,
and its great sandworms are dying.
Now the Lost Ones are returning home in pursuit of power. And as
these factions vie for control over the remnants of the Empire, a
girl named Sheeana rises to prominence in the wastelands of Rakis,
sending religious fervor throughout the galaxy. For she possesses
the abilities of the Fremen sandriders—fulfilling a prophecy
foretold by the late God Emperor....
In the evening I started in book 5 of the Dune Chronicles by Frank
Herbert: Heretics of Dune.
Even with a lot of help from a good text editor, writing HTML can be
a drag. Nice documents end up as tag-swamps with little bits of
content perched atop hills of tabs. Editing them becomes a test of
patience and we get sick at the thought of having to look at our
once-loved text. It doesn't have to be like this! There's a
lightweight, easygoing way to write HTML that's been around since
the beginning of the web.
We developed a system to detect data races at Uber using a dynamic
data race detection technique. This system, over a period of six
months, detected about 2,000 data races in our Go code base, of
which our developers already fixed ~1,100 data races.
The other day I got a question about some old code I had written
which, instead of raising an exception for an error condition as the
reader expected, returned an error object.
I've decided some weeks ago to (try to) adopt the method of David
Allen named "Get Things Done" (GTD). A lot of people were giving
very positive feedback about this method and there are a lot of
related resources online, including several Emacs/org-mode
setup. This helped me a lot to design my own setup since I did not
read the book, but I found a nice
summary:
Capture anything that crosses your mind, nothing is too big or small.
Clarify what you’ve captured into clear and concrete action steps.
This topic is close to my heart. After all, at lunatic we are
building a Rust runtime with the performance characteristics of
async Rust, but without the issues of async Rust. It brings Rust
back to its pre-1.0 days when it still used user space threads as
a concurrency model.
In this blog post I would like to compare both approaches and show
the differences between the programming models and runtime
characteristics.
When you’re processing data with Pandas, so-called “vectorized”
operations can significantly speed up your code. Or at least, that’s
the theory.
In practice, in some situations Pandas vectorized operations can
actually make your code slower, or at least no faster. And they can
also significantly increase memory usage.
Let’s dig in and see what vectorization means in Pandas, when and
why it helps, and when it’s harmful.
You didn't write that awful page. You're just trying to get some
data out of it. Beautiful Soup is here to help. Since 2004, it's
been saving programmers hours or days of work on quick-turnaround
screen scraping projects.
Beautiful Soup is a Python library designed for quick turnaround
projects like screen-scraping.
If you’re new to Emacs, you may wonder why you read and write text
from buffers as opposed to, you know, files or
documents. There’s the fact that it’s not skeuomorphic, and thus
the term lacks the spark that connects it to a real-life
concept. Most people have heard of files and documents in real
life, and the term buffer is instead a capacious term with little
grounding to most people.
Back in 2011, Rob Pike gave a talk on the topic of Lexical Scanning
in Go, where he
presented an interesting approach to lexical analysis with
coroutines (implemented via goroutines communicating over a
channel). Since I've been pondering the connection between
coroutines and state
machines
in the past, Rob's talk inspired me to try approximating this
approach in Python using
sub-generators.
GHC is built on a raft of primitive data types and operations;
“primitive” in the sense that they cannot be defined in Haskell
itself. While you really can use this stuff to write fast code, we
generally find it a lot less painful, and more satisfying in the
long run, to use higher-level language features and libraries. With
any luck, the code you write will be optimised to the efficient
unboxed version in any case. And if it isn’t, we’d like to know
about it.
Commandline folklore: sorting files by filename or content before
compression can save large amounts of space by exposing redundancy
to the compressor. Examples and comparisons of different sorts.
A new and shiny version of Perl,
5.36
has been released last week. It contains a lot of very nice
improvements and new
features. As
I'm also currently starting a fresh project, I decided it's a good
time to build a new docker (in fact podman) base image to use for
some new apps / scripts etc.