week 06, 2023

Triple Frontier (2019)

Loyalties are tested when five friends and former special forces operatives reunite to take down a South American drug lord, unleashing a chain of unintended consequences.

In the evening Alice, Esme, and I watched Triple Frontier. I liked the movie and give it a 7 out of 10.

Why I'm not the biggest fan of Single Page Applications

Nevertheless, there is also valid and serious professional criticism. With this post I’m not trying to convince anyone to build their websites differently, I just want to share my view and my experiences as someone who has been building websites for over 20 years, and I try to summarize reasons why some developers, including me, are wary of building SPAs.

Source: Why I'm not the biggest fan of Single Page Applications, an article by Manuel Matuzović.

Building conc: Better structured concurrency for Go

Go is designed to make concurrency easier than it is in other languages, but at Sourcegraph, I still found myself running into the same problems repeatedly when writing concurrent code.

In particular, it is difficult to write concurrent code that operates reasonably in the face of panics. We don't want the entire process to crash when a panic occurs in a spawned goroutine, and we want to avoid other problems that can be triggered by panics like deadlocks or leaked goroutines. Go does not provide an easy way to do this natively.

So I built conc, a library that makes writing concurrent code more elegant and reduces the amount of boilerplate code.

Source: Building conc: Better structured concurrency for Go, an article by Camden Cheek.

13 tips and techniques for modern Flask apps

Flask is approaching its 13th birthday in active development, with new features that make it easier for you to build your web application continually being added. Thirteen years ago the industry and Flask focused on server rendered pages, now there is a strong focus on JSON APIs. Flask has kept up with this change by adding features that make API development easier.

In this article I've picked out 13 tips, for the 13 years of development, that make modern Flask ideal.

Source: 13 tips and techniques for modern Flask apps, an article by Philip Jones.

Shells are Two Things

The fundamental problem of shells is they are required to be two things.

  1. A high-frequency REPL, which requires terseness, short command names, little to no syntax, implicit rather than explicit, so as to minimize the duration of REPL cycles.
  2. A programming language, which requires readable and maintainable syntax, static types, modules, visibility, declarations, explicit configuration rather than implicit conventions.

And you can’t do both. You can’t be explicit and implicit, you can’t be terse and readable, you can’t be flexible and robust.

Source: Shells are Two Things, an article by Fernando Borretti.

Profile-guided optimization preview

With no definitive information about how the code is used in a production environment, the compiler can operate only on the source code of packages. But we do have a tool to evaluate production behavior: profiling. If we provide a profile to the compiler, it can make more informed decisions: more aggressively optimizing the most frequently used functions, or more accurately selecting common cases.

Using profiles of application behavior for compiler optimization is known as Profile-Guided Optimization (PGO) (also known as Feedback-Directed Optimization (FDO)).

Source: Profile-guided optimization preview, an article by Michael Pratt.

Hardcoded Folder Icons in macOS

Are there any other hardcoded folder names in macOS? Where would I even start looking?

Well, based on what I know, every program on macOS is a directory that ends with .app, which means all I have to do is to find Finder’s location.

Source: Hardcoded Folder Icons in macOS, an article by Antranig Vartanian.

Docker Without Docker

Docker images are simply compressed tarballs with some metadata. The format is a little complicated to understand because it has many years of path-dependent technical debt baked into it. But this means you can construct them in any way you'd like – you don't need a Docker daemon, installation, or special environment. Package up the files, add the relevant metadata, and you'll be able to push, pull, and run them.

Source: Docker Without Docker, an article by Matt Rickard.

Mypy 1.0 Released

We’ve just uploaded mypy 1.0 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes.

Source: Mypy 1.0 Released, an article by Stas Ilinskiy.

How I added C-style for-loops to Python

It's true. It turns out you can, in fact, add C-style for loops into Python. The way to get there however, was long and painful all the way to the end.

Regardless, I've learned many things (some of which I hope nobody ever uses in production), and I'm here to share with you all the gruesome details. I hope you find it helpful (or at the very least, entertaining).

Source: How I added C-style for-loops to Python, an article by Tushar Sadhwani.

Speeding up the JavaScript ecosystem - eslint

Overall eslint is so flexible, that you can even swap out the parser for a completely different one. That's not a rare scenario either as with the rise of JSX and TypeScript that is frequently done. Enriched by a healthy ecosystem of plugins and presets, there is probably a rule for every use case out there and if there isn't, the excellent documentation guides you on how to create your own rules. That's one thing I want to highlight here as it's a project that has stood the test of time.

But this also poses a problem for performance profiling as due to the vastness of the configuration flexibility two projects can have a widely different experience when it comes to linting performance. We need to start somewhere though, so I figured what better way to start our investigation than to look at the linting setup used in the eslint repository itself!

Source: Speeding up the JavaScript ecosystem - eslint, an article by Marvin Hagemeister.