Plurrrr

week 44, 2021

Emacs & Emojis: A ❤ Story

Emacs grew support for displaying colour emojis recently (and this is included in the release branch, which will become Emacs 28.1 in some months). This includes support for the grapheme cluster emojis (that consist of a number of Unicode code points, joined together with zero-width joiners and magic).

Source: Emacs & Emojis: A ❤ Story, an article by Lars Ingebrigtsen.

A terrible schema from a clueless programmer

The first time you encounter something, you're probably going to make some mistakes. There's a post going around tonight about how someone forgot to put an index on some database thing and wound up doing full table scans (or something like that). The rub is that instead of just being slow, it also cost a fair amount of money because this crazy vendor system charged by the row or somesuch. So, by scanning the whole table, they touched all of those rows, and oh hey, massive amounts of money just set ablaze!

The usual venues are discussing it, and I get the impression some people have the wrong approach to this. I want to describe a truly bad database schema I encountered, and then tell you a little about what it did to the system performance.

Source: A terrible schema from a clueless programmer.

It's Time to Get Hyped About Const Generics in Rust

One of the most interesting emergent properties of the Rust language has been the desire and ability to push more and more information into the type system. Other programming languages allow this, but Rust’s combination of speed, safety, and extremely powerful compile-time computation through both types and macros, have lead to a large ecosystem of highly capable libraries that do much of their work before the program ever runs.

Recent developments in the type system are making it easier than ever for programmers to take advantage of that power, and things are only going to get more interesting.

Source: It's Time to Get Hyped About Const Generics in Rust, an article by Leonora Tindall.

Guide of CPython’s Parser

The Parser in CPython is currently a PEG (Parser Expression Grammar) parser. The first version of the parser used to be an LL(1) based parser that was one of the oldest parts of CPython implemented before it was replaced by PEP 617. In particular, both the current parser and the old LL(1) parser are the output of a parser generator. This means that the way the parser is written is by feeding a description of the Grammar of the Python language to a special program (the parser generator) which outputs the parser. The way the Python language is changed is therefore by modifying the grammar file and developers rarely need to interact with the parser generator itself other than use it to generate the parser.

Source: Guide of CPython’s Parser, an article by Pablo Galindo Salgado.

Reducing Memory Allocations in Golang

Go’s place between C and Python in terms of abstraction and garbage collection memory management model has made it attractive to programmers looking for a fast but reasonably high level language. However, there is no free lunch. Go’s abstractions, especially with regards to allocation, come with a cost. This article will show ways to measure and reduce this cost.

Source: Reducing Memory Allocations in Golang, an article by Christopher Tarry.

Hypocritical Gophers

Most of my time over the past two years has been developing primary in Go. If you’re not familiar with the Go programming language let me sum it up for you real quick: take a modern, statically-linked, type-strict language and remove every advancement in development in the last 10 years or so, do some pretentious talks about how your language is the best one out there, and you have Go. Now, don’t get me wrong, Go is a fantastic language. The problem is that its also a horrible language.

Source: Hypocritical Gophers, an article by Peter Christian Fraedrich.

An oral history of Bank Python

Today will I take you through the keyhole to look at a group of software systems not well known to the public, which I call "Bank Python". Bank Python implementations are effectively proprietary forks of the entire Python ecosystem which are in use at many (but not all) of the biggest investment banks. Bank Python differs considerably from the common, or garden-variety Python that most people know and love (or hate).

Source: An oral history of Bank Python, an article by Cal Paterson.

A Haskell memory leak in way too much detail with Cachegrind

So, if you’re interested in low-level optimization of your Haskell programs then this article is for you. I’ll demonstrate the use of a valgrind tool, cachegrind, to inspect the behavior of the canonical leaky Haskell program: a lazy left fold. You’ll get three things: (1) a step-by-step tutorial on running cachegrind on your programs. (2) a section-by-section breakdown of the cachegrind profile, and (3) some guidance on interpreting the results.

Source: A Haskell memory leak in way too much detail with Cachegrind, an article by Jeffrey Young.

Async await in Swift explained with code examples

Async await is part of the new structured concurrency changes that arrived in Swift 5.5 during WWDC 2021. Concurrency in Swift means allowing multiple pieces of code to run at the same time. This is a very simplified description, but it should give you an idea already how important concurrency in Swift is for the performance of your apps. With the new async methods and await statements, we can define methods performing work asynchronously.

You might have read about the Swift Concurrency Manifesto by Chris Lattner before, which was announced a few years back. Many developers in the Swift community are excited about the future to come with a structured way of defining asynchronous code. Now that it’s finally here, we can simplify our code with async-await and make our asynchronous code easier to read.

Source: Async await in Swift explained with code examples, an article by Antoine van der Lee.

Goto

In this programmer’s opinion, you should use whichever constructs leads to the best code, factoring in maintainability and speed. And sometimes this might be goto!

Source: goto, an article by Brian “Beej Jorgensen” Hall.

Install Python packages from git repository with pip

When it comes to packages probably every Python developer thinks of pypi. This is the most common way of distribution them in the ecosystem.

But there are several cases where packages are in a progress or pre alfa state in which a package maintaner considers a release is too early. Or in other cases packages are only ment to be used internally. One solution is to install such packages is via git.

Source: Install Python packages from git repository with pip, an article by Harald Nezbeda.

Spiders are much smarter than you think

People tend to associate intelligence with brain size. And as a general guideline, this makes sense: more brain cells, more mental capabilities. Humans, and many of the other animals we’ve come to think of as unusually bright, such as chimpanzees and dolphins, all have large brains. And it’s long been assumed that the smallest brains simply don’t have the capacity to support complex mental processes. But what if they do?

The vast majority of Earth’s animal species are rather small, and a vanishingly small portion of them have been studied at all, much less by cognition researchers. But the profile of one group of diminutive animals is rapidly rising as scientists discover surprisingly sophisticated behaviors among them.

“There is this general idea that probably spiders are too small, that you need some kind of a critical mass of brain tissue to be able to perform complex behaviors,” says arachnologist and evolutionary biologist Dimitar Dimitrov of the University Museum of Bergen in Norway. “But I think spiders are one case where this general idea is challenged. Some small things are actually capable of doing very complex stuff.”

Source: Spiders are much smarter than you think, an article by Betsy Mason.

Haskell series part 6

In this article we are going to cover higher order functions. It sounds like a big word, but this is something very natural that we are using without realizing it most of the time.

Source: Haskell series part 6, an article by Pierre Guillemot.