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
language.
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
module
documentation
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
later).
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.
Although UDP is simple in principle, there is a lot of domain
knowledge needed to run things at scale. In this blog post we'll
cover the basics: all you need to know about UDP servers to get
started.
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
opinions.
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.
Recently, a group of Haskellers within Tweag had a knowledge-sharing
event where we shared our varied Haskell setups with each other, and
learned some nice tricks and tips for every-day life.
The idea was raised of sharing these findings via the blog, so
without further ado, let’s explore the varieties of the Tweag
Haskelling experience by covering a few of our personal setups!
Transformers were introduced in this 2017
paper
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.
Whenever I start a new project, the first order of business is to
sand down some of the rough edges in the CSS language. I do this
with a functional set of custom baseline styles.
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
noticed
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.
My hope is that by exposing a list of my personal tmux
configurations and my reasoning behind them, you will see a general
pattern and understand it enough to make tmux your own.
I tried to learn Nix, and it was pretty hard. I kept a diary of
every command I tried, every wrong assumption that I made, and every
realization that I had along the way.
As of a couple weeks ago, Docker’s BuildKit tool for building
Dockerfiles now supports heredoc
syntax!
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.