Python supports default values for arguments to functions, but those
defaults are evaluated at function-definition time. A proposal to
add defaults that are evaluated when the function is called has been
discussed at some length on the python-ideas mailing list. The idea
came about, in part, due to yet another resurrection of the
proposal for None-aware
operators in Python. Late-bound
defaults would help with one use case for those operators, but there
are other, stronger reasons to consider their addition to the
Calling Rust code from Python is made easy by
PyO3. You can write a Rust library
and rely on the combination of PyO3 and maturin, a supporting tool
from the PyO3 ecosystem, to compile the Rust library and have it
installed directly as a Python module. Among others, PyO3 can
translate types between Python and Rust as well as make it easy to
export Rust functions to Python through a set of macros.
Inside pretty well every folder that you’ve ever opened is a hidden
file, one which even showing hidden files doesn’t reveal:
.DS_Store. As with other under-the-hood features which Apple
really doesn’t want you to know about, you’ll only come across it
when it causes trouble.
Pinning in Rust is a powerful and very convenient pattern that is,
in my eyes, not supported well enough in the wider ecosystem.
A common sentiment is that it's hard to understand and that the pin
is confusing. (Personally, I think it works well as reference to
answer questions about edge cases, but it's a dense read and not
necessarily a good intro text.)
This post is my attempt to make the feature more approachable, to
hopefully inspire more developers to make their crates pinning-aware
where that would be helpful.
The Load Balancers play a significant role in any System
Design. And the beauty of its design is that every engineer takes
it for granted, that this will work — one of the best system designs
and a lot to learn from this simple yet powerful solution. The LB
acts as a middle-man between clients and servers; the client sends
requests to LB and internally, via physical NIC to VIPs, forwards to
attached web servers.
I have been working on a serialization project recently that
involves endianness (also known as byte order), and it caused me to
explore parts of the Rust standard library that deals with
endianness, and share my thoughts about how endianness should be
represented in a programming language and its standard library, as I
think this is also something that Rust does better than C++, and
also makes for a good case study to talk about API design and
polymorphism in Rust.
If you work a lot with containers, then there’s a good chance you’ve
wanted to look inside a running container’s filesystem at some
point. Maybe the container is failing to run properly and you want
to read some logs, maybe you want to check some configuration files
inside the container...or maybe you’re like me and want to place
some eBPF probes on the binaries in that container (more on this
A simple act of kindness always sparks another, even in a frozen,
faraway place. When Smeerensburg's new postman, Jesper, befriends
toymaker Klaus, their gifts melt an age-old feud and deliver a
sleigh full of holiday traditions.
In the evening we watched
Klaus. I liked the movie and
give it a 7 out of 10.
Modern languages such as Go, Julia and Rust don’t need complex
garbage collectors like the ones use by Java C#. But why?
To explain why, we need to get into how garbage collectors work and
how different languages allocate memory in different ways. However,
we will start by looking at why Java in particular needs such a
complex garbage collector.
Here at Typeable, we use Haskell as the main development language
and, while everyone else was disputing whether Haskell is ready for
production, we just used it and regarded this as a competitive
advantage. Based on this experience, we would like to share our
I’ve been lurking the fish shell for a
couple of years now (and the
nushell but it is another
story for another time). Not so long ago, I decided to try it, and
it’s simply… amazing. If I had to state one feature that makes me
like to use it, it’ll be the autocompletion, hands down. It’s the
first time I just take a shell and without customization it’s
pleasing to use.
Transformers were introduced in this 2017
as a tool for sequence transduction—converting one sequence of
symbols to another. The most popular examples of this are
translation, as in English to German. It has also been modified to
perform sequence completion—given a starting prompt, carry on in the
same vein and style. They have quickly become an indispensible tool
for research and product development in natural language processing.
You might be surprised to hear when you visit a file in Emacs that
the syntax highlighting you are shown on your screen is – most
likely – a potpourri of regular expressions with a dash of functions
and syntax table definitions. As it turns out, this approach is just
about good enough right up until the point where it isn’t.
Some googling showed me that over past 11 years people have
that Firefox uses optimized zip files. This inspired me to
document thinking behind the optimized zip format I implemented in
Firefox in the pre-pandemic 2010.
As of a couple weeks ago, Docker’s BuildKit tool for building
Dockerfiles now supports heredoc
With these new improvements, we can do all sorts of things that were
difficult before, like multiline RUNs without needing all those
pesky backslashes at the end of each line, or the creation of small
inline configuration files.
By reading this tutorial, you’ll learn how to use
PostgreSQL with the
Go programming language using the
pgx driver and toolkit in a very
productive manner. Furthermore, with the provided source code,
you’ll be able to learn how to write efficient and sound unit and
integration tests, ready to be run locally or on a Continuous
Integration environment, such as GitHub Actions.