A common trope is how, if one wants to build a game, one should
build a game, rather than a game engine, because it is all too easy
to fall into a trap of building a generic solution, without getting
to the game proper. It seems to me that the situation with code
editors is the opposite — many people build editors, but few are
building “editor engines”. What’s an “editor engine”? A made up term
I use to denote a THIN
WAIST the
editor is build upon, the set of core concepts, entities and APIs
which power the variety of editor’s components. In this post, I will
highlight Emacs’ thin waist, which I think is worthy of imitation!
Comprehensions are currently compiled as nested functions, which
provides isolation of the comprehension’s iteration variable, but is
inefficient at runtime. This PEP proposes to inline list,
dictionary, and set comprehensions into the code where they are
defined, and provide the expected isolation by pushing/popping
clashing locals on the stack. This change makes comprehensions much
faster: up to 2x faster for a microbenchmark of a comprehension
alone, translating to an 11% speedup for one sample benchmark
derived from real-world code that makes heavy use of comprehensions
in the context of doing actual work.
The GHC team is very pleased to announce the availability of the
first (and likely final) release candidate of GHC 9.6.1. As usual,
binaries and source distributions are available at
downloads.haskell.org.
Beginning with GHC 9.6.1, GHC can be built as a cross-compiler to
WebAssembly and JavaScript. This is an important step towards robust
support for compiling Haskell to the Web, but there are a few
caveats to be aware of in the 9.6 series:
Both the Javascript and WebAssembly backends are still at an early
stage of development and are present in this release as a
technology preview
Using GHC as a cross-compiler is not as easy as we would like it
to be; in particular, there are challenges related to Template
Haskell
GHC is not yet run-time retargetable; a given GHC binary targets
exactly one platform, and both WebAssembly and JavaScript are
considered platforms for this purpose. Cross-compilers must be
built from source by their users
We hope to lift all of these limitations in future releases.
Additionally, 9.6.1 will include:
Significant latency improvements in the non-moving garbage
collector
Efficient runtime support for delimited continuations
Improvements in compiler error messages
Numerous improvements in the compiler’s memory usage
See the release
notes
for a comprehensive accounting of changes in this release.
SPAs are really hard to get right, but what exactly is hard about
them? As always, its state, but a specific kind of state.
Whenever you fetch data from the server and store that data in any
shared state management solution, your application is very often
lying to your users.
I’m excited to announce two new open source Swift packages:
swift-certificates
and swift-asn1. Together,
these libraries provide developers a faster and safer implementation
of X.509 certificates, a critical technology that powers the
security of TLS.
Regular
expressions are
fascinating to me. On one hand, they can be extremely succinct,
expressive, and efficient. On the other hand, they can be basically
write-only. They
come with a simple but powerful
theory
that leads to efficient implementations. Sadly, many implementations
ignore the theory in order to offer additional
features,
at the cost of worst-case exponential
complexity.
It is possible, however, to implement some of those additional
features, and still operate in worst-case linear time. The
implementation (~400 lines of Rust) even fits in a single blog post!
The full code is on
GitHub,
and the commit
history lines
up with the blog post if you want to follow along.
Since the last post I've been in contact with some members of the
Nix community with regards to joining the documentation team. From
that discussion and my experience with other ecosystems I've had
some ideas rolling around about what the ideal Nix documentation
strategy/ecosystem would look like to me, so I'm putting those ideas
in writing to start a discussion and generate ideas. These ideas
aren't super concrete and I don't speak for anyone else, but they're
my vision for how Nix documentation could better serve experienced
users and onboard new ones.
In general, anything that requires reasoning—like programming, or
applying the scientific method—long-term planning, and
algorithmic-like data manipulation, is out of reach for deep
learning models, no matter how much data you throw at them. Even
learning a sorting algorithm with a deep neural network is
tremendously difficult.
Nowadays, Alpine Linux is one of the most popular options for
container base images. Many people (maybe including you) use it for
anything and everything. Some people use it because of its small
size, some because of habit and some, just because they copy-pasted
a Dockefile from some tutorial. Yet, there are plenty of reasons
why you should not use Alpine for your container images, some of
which can cause you great amount of grief...
Rust is designed around safety and soundness. Roughly speaking, safe
code is code that doesn't use the unsafe keyword, and sound code
is code that can't cause memory corruption or other undefined
behavior. One of Rust's most important features is the promise that
all safe code is sound. But that promise can be broken when unsafe
code is involved, and unsafe code is almost always involved
somewhere. Data structures like Vec and HashMap have unsafe
code in their implementations, as does any function like
File::open that talks to the OS. This leads to a common question:
"If Rust can't guarantee that all safe code is sound, how can it
be a memory-safe language?" It's hard to give a short answer to
that question, so this post is my attempt at a medium-length answer.
Sites take time to build these days. A large Next.js 11 site will
take several minutes to build. This is wasted time in the
development cycle. Build tools like Vite or
Turbopack highlight their ability to get
this number down.
In the afternoon I finally finished To Green Angel Tower, Part
2,
part 2 of book 3 of Memory, Sorrow and Thorn by Tad Williams. I liked
the trilogy and recommend it if you like to read fantasy.
While having a drink inside Brasserie
Mirell Esme spotted a cat in one of the
planters. When we left the restaurant I checked if the cat was still
there, and it was. When I petted it, it woke up just a little.
Los Angeles is a city of stark contrast, the palaces of the affluent
coexisting uneasily with the hellholes of the mad and the
needy. That shadow world and the violence it breeds draw brilliant
psychologist Dr. Alex Delaware and Detective Milo Sturgis into an
unsettling case of altruism gone wrong.
On a superficially lovely morning, a woman shows up for work with
her usual enthusiasm. She’s the newly hired personal assistant to a
handsome, wealthy photographer and is ready to greet her boss with
coffee and good cheer. Instead, she finds him slumped in bed, shot
to death.
The victim had recently received rave media attention for his latest
project: images of homeless people in their personal “dream”
situations, elaborately costumed and enacting unfulfilled
fantasies. There are some, however, who view the whole thing as
nothing more than crass exploitation, citing token payments and the
victim’s avoidance of any long-term relationships with his subjects.
Has disgruntlement blossomed into homicidal rage? Or do the roots of
violence reach down to the victim’s family—a clan, sired by an
elusive billionaire, that is bizarre in its own right?
Then new murders arise, and Alex and Milo begin peeling back layer
after layer of intrigue and complexity, culminating in one of the
deadliest threats they’ve ever faced.
In the evening I started in Unnatural
History,
an Alex Delaware novel by Jonathan Kellerman.
Nox is an incredible tool, I use it for
all my Python projects, highly recommend it. One of the best
features of nox and tools like it is
parameterization. Usually
this is done for the test suite portion where you want to run your
test suite on many different Python versions (and maybe other things
like dependency versions).
Hello! For some reason after the last nix
post I
got nerdsniped by trying to understand how Nix builds work under the
hood, so here’s a quick exploration I did today. There are probably
some mistakes in here.
A truck driver has been forced to smuggle illicit cargo to save her
brother from a deadly prison gang. With FBI operatives hot on her
trail, Sally's conscience is challenged when the final package turns
out to be a teenage girl.
In the evening Esme and I watched Paradise
Highway. I liked the movie and
give it a 7 out of 10.
Long time no see! While I have a few other, longer blog posts still
cooking, I figured I’d post about a cool bit of CSS I came across on
eli_oat’s site which adds a marker to every
link on a site that points to an external domain.
Bitwise operations are a fundamental part of Computer Science. They
help Software Engineers to have a deeper understanding of how
computers represent and manipulate data, and they are crucial when
writing performance-critical code. Truth being said, nowadays, they
are rarely used in the business code we write, and they stay hidden
in libraries, frameworks, or low-level system programming
codebases. The reason is simple: writing code that operates on bits
can be tedious, less readable, not always portable, and, most
importantly, error-prone. Modern programming languages nowadays have
higher-level abstractions that replace the need for bitwise
operations and “constructs”, and trading (potential) small
performance and memory gains for readability is not such a bad
deal. Plus, compilers are more intelligent nowadays and can optimise
your code in ways you (and I) cannot even imagine.
Rust is a low-level language, and its standard library is careful to
give the programmer lots of control over how things will behave and
avoid implicit behavior, especially when that behavior impacts
performance. But at the same time, it doesn't want to make the
programmer's life harder than it needs to be. As a result, Rust's
language features and standard library often give you access to
really low-level concepts with no assumptions baked in, but then
also give you abstractions you can optionally layer on top.
One example of this is the Read and BufRead traits. Read is a
low-level and unopinionated abstraction for ingesting data from
things like files, network sockets, and process input, while
BufRead represents a specific kind of layer you can choose to put
on top of Read to make it slightly higher-level.
Work on c++23 standardisation is well in progress and we already
have a couple of new features to play with. Toolchain
support
varies but some early testing is already possible. I’ve prepared a
list of features that I, personally appreciate a lot and which most
definitely will improve my code.
Benchmarks are only a tool for debugging efficiency: Production is
ultimately what matters. Benchmarks analyze the performance of code
under the specific circumstances created and maintained by the
benchmark. They cannot perfectly predict the performance of code in
the real world. In this episode, we discuss some of the pitfalls of
microbenchmarks and mitigation strategies.
Recently I started using a Mac for the first time. The biggest
downside I’ve noticed so far is that the package management is much
worse than on Linux. At some point I got frustrated with homebrew
because I felt like it was spending too much time upgrading when I
installed new packages, and so I thought – maybe I’ll try the
nix package manager!
nix has a reputation for being confusing (it has its whole own
programming language!), so I’ve been trying to figure out how to use
nix in a way that’s as simple as possible and does not involve
managing any configuration files or learning a new programming
language. Here’s what I’ve figured out so far! We’ll talk about how
to:
install packages with nix
build a custom nix package for a C++ program called
paperjam
Git users think about branches and talk about branches. The Git
documentation talks about branches and many of the commands mention
branches. Pay attention to what experienced users say about branches
while using Git, and it will be clear that they do not think of
branches simply as just refs. In that sense, branches do exist: they
are part of our mental model of how the repository works.
This document was originally written around 1997 for GNU Emacs
version 19.29 and published under the title A Tutorial Introduction
to GNU Emacs. It has subsequently been updated for version 28.2,
and thoroughly revised and expanded. This is document version
28.2.43 and is an unfinished work-in-progress.
In the last few years, there has been a renaissance in command-line
utilities. If you are still using utilities written 30 years ago
(groan) you will be in for a surprise. The functionality might be
the same but the UX(or is it developer experience) is a million
times better.
These are some of the best command line utilities I've come across,
ones I highly recommend.
In short: in my experience, if a single programmer builds
something, it’s often hard for others to maintain later. There are
several possible reasons why. Even great programmers fall into this
trap!
I've been following the Nix project for a while but now that I'm
done with my PhD I finally have some free time and energy to try
using it in earnest. This series is going to be me learning Nix by
showing you how things work and how to put the pieces together.
For those of you unaware, Nix takes reproducible builds to their
logical conclusion by making package builds (mostly) pure functions
of their dependencies. The binary artifacts of builds are stored in
a content-addressed store (the Nix store) so you can be sure that
you're always getting the same package if you have its name and
hash. Not only can you build programs this way, but you can also
build development environments ("I want these libraries available in
my build environment and nothing else", for example), run commands
in throw-away environments with specific packages installed without
polluting your global environment. There's even an operating system,
NixOS, based on this packaging system that allows you to configure
your whole system (installed packages, system settings, etc) from a
single file.
We at Determinate Systems are extremely excited to announce the
release of the Determinate Nix
Installer, a
brand-new installer for Nix. You can run the
installer on a variety of
systems,
including macOS, Linux, Windows via WSL2, and more.
Those are the strengths of the newtype pattern: You create your
name and slap a bunch of traits on it to explicitly and
intentionally tell what the purpose of this struct is. The API
speaks for itself, and it becomes much clearer what we can expect.
I am of the belief that currently, Python is actually two very
similar programming languages sharing the same name. This certainly
isn't a surprise to anyone who's been using Python for a while. What
might be a surprise, though, is that I think this is actually a
good thing. The languages, let's call them untyped Python and
typed Python, even though sharing a very large common base are
fundamentally different in how they enable the developers using them
to solve problems.
In the morning my brother Marco picked us up to go to the Terraria
Expo
in the city of Houten, near the city of Utrecht. I had been looking
forward to this expo for quite some time and was considering to buy
two tarantulas that were on my wish list for some time:
Monocentropus balfouri (Socotra Island Blue Baboon tarantula)
Tliltocatl albopilosus (Curlyhair tarantula)
Soon after we had entered the expo building a man walked towards us
holding a ferret. Alice loved the ferret and soon was holding the
excited animal. While I took some photos she got softly bitten in her
chin by the ferret.
Alice holding a Mustela furo (ferret).
After we had looked a bit around in the small area with mostly rodents
we entered the large one with many tables. Soon we came upon the table
of Dawid Staroń's Exotic Spiders. In the past I had ordered three
tarantula slings with
Dawid. Sadly, after some time, two died. I still keep the Ephebopus
cyanognathus, which remains mostly well hidden.
Dawid Staroń's Exotic Spiders.
The majority of the tables was assigned to selling reptiles and
amphibians. We looked at the beautiful but pricey snakes on
display. At the table of EC Reptiles I took
several photos of Python regius on display.
Python regius on display.
After some more walking we came upon the table of the Belgian
Tarantula Breeding Team. They had both spiders
I wanted; a large female Monocentropus balfouri and an even larger
female Tliltocatl albopilosum [sic]. But since we where half way the
large expo area I decided to keep looking around a bit more.
Belgian Tarantula Breeding Team
A while later I decided to return and make the purchase of the two
tarantulas I had seen. I paid €70 for the Monocentropus balfouri and
€50 for the Tliltocatl albopilosus. Female tarantulas are more
expensive because they live much longer compared to males.
After the expo we decided to have lunch. My brother knew a place
nearby but sadly it was loaded and no space for us. So we went to
another restaurant he knew in the city of Zoetermeer. After a nice
late lunch he dropped us of at our home.
Tliltocatl albopilosus in her terrarium.
Back home I repurposed two terrariums, large plastic containers, that
belonged to animals that sadly had passed away. The first one for the
Tliltocatl albopilosus female. Moving her from the small plastic
container into the terrarium went easy. The terrarium had already a
starter burrow which she soon after found and used to hide from view.
Monocentropus balfouri in her terrarium.
Next, I moved the Monocentropus balfouri into her terrarium. This
was a bit more challenging: the spider moved way faster than the
previous one even before I had opened the container she came in. After
I carefully had removed the lid I carefully pushed her with a large
tweezer I had also bought at the expo. She threat posed a few times
but nothing serious.
Acanthoscurria geniculata eating a superworm Zophobas morio
After I had housed the two new tarantulas I fed the following four
tarantulas each a superworm Zophobas morio — I had bought two small
containers at the expo as well:
When Puss in Boots discovers that his passion for adventure has
taken its toll and he has burned through eight of his nine lives, he
launches an epic journey to restore them by finding the mythical
Last Wish.
An alarming 87% of container images running in production have
critical or high-severity vulnerabilities, up from 75% a year ago,
according to the "Sysdig 2023 Cloud-Native Security and Usage
Report."
Yet only 15% of those unpatched critical and high-severity
vulnerabilities are in packages in use at runtime when patches are
available.
I was recently debugging an issue in some integration-style Go tests
which made me realize that I didn't have a very deep understanding
of how parallelism works when using go test. I knew that there
were ways that Go could parallelize tests, and I thought it had
something to do with using t.Parallel() inline in each of my test
functions.
Because I feel the concurrency behavior of go test is non-obvious,
and for posterity so I don't forget in the future, I wanted to write
something up here to document my understanding of how go test
parallelization works as of Go 1.19.
Python has long had a monopoly on data workflows — everything from
data analysis to data science to machine learning. Anything that
can't be done in SQL is done in Python. But Python won't be the
language for LLMs.
Flutter Rust
bridge is super
useful project that allows you to call Rust code from
Flutter. Instead of manually writing FFI methods and type
conversions, bridge will generate all that glue code for you.
Emacs has long had a competent spell checker, and it's capable of
distinguishing code from prose, which is useful to many. But Emacs
28 adds a compelling dictionary lookup feature that warrants a much
closer look.
Looking to set up a virtualization server? Proxmox is a popular
choice for IT professionals and tech enthusiasts alike. With its
user-friendly interface and powerful features, Proxmox makes it easy
to run virtual machines on your own hardware. In this guide, we’ll
walk you through the process of installing Proxmox on your
server. Whether you’re new to virtualization or a seasoned pro,
we’ve got you covered.