Plurrrr

week 37, 2022

Shorter Hacks 16: IPython Autoreload

When developing some python code and testing it in IPython, I love the autoreload feature of IPython. When enabled it will reload imported modules automatically. So you will always use the newest version of your code. It even patches modifications on class methods into existing class instances. To enable it first load it with %load_ext autoreload, then enable it with %autoreload 2 – See the documentation for explanations of the options and how to autoreload only selected imports.

Source: Shorter Hacks 16 IPython Autoreload, an article by Michael F. Schönitzer.

Distributed Tracing in Rust

Here is another shot at distributed tracing in Rust. I saw multiple articles online but sadly none gave me the necessary tips to make distributed tracing work in my context.

What I wanted to achieve was to get a complete trace starting from the API request to the database across multiple services communicating through AMQP.

This article will guide you through every steps required to instrument your application.

Distributed Tracing in Rust, an article by Romain Lebran.

Manage containers on Fedora Linux with Podman Desktop

Podman Desktop is an open-source GUI application for managing containers on Linux, macOS, and Windows.

Historically, developers have been using Docker Desktop for graphical management of containers. This worked for those who had Docker Daemon and Docker CLI installed. However, for those who used Podman daemon-less tool, although there were a few Podman frontends like Pods, Podman desktop companion, and Cockpit, there was no official application. This is not the case anymore. Enter Podman Desktop!

Source: Manage containers on Fedora Linux with Podman Desktop, an article by Mehdi Haghgoo.

Ten challenges for Rust

Rust is in a pretty good place; it is getting more and more popular, has more and more contributors, and is used in some pretty significant places. However, it is a time of flux and change, and transitioning from a research project then a new, rapidly changing language to a popular, established project is a difficult change.

Here, I want to describe what I think are the ten biggest challenges for Rust for now and the next few years. I have some ideas for solutions, but they are all big, difficult questions with no simple answer, so the real solutions will all take iteration, energy, and creativity. My focus is on the core project; there are many challenges for the community and ecosystem (e.g., how to make GUIs with Rust, or how to get more crates to 1.0) which I think must be primarily solved by the community.

Source: Ten challenges for Rust, an article by Nick Cameron.

Photography for geeks

Billions of people carry cameras in their pockets and use them to document their lives. Yet, despite the democratization of the hardware, the knowledge of photographic techniques remains elusive. Countless books, webpages, and YouTube videos purport to offer advice, but tend to dwell on topics of little consequence - such as shopping for gear or memorizing made-up rules of composition that seldom make for a good shot.

I'm not a pro, but I dabbled in photography for more than two decades - and after making countless mistakes, I have gotten fairly good. This page is an impassioned contrarian take on what it takes to snap great photos, along with a set of simple experiments that can be repeated at home.

Source: Photography for geeks, an article by Michal Zalewski.

Metaprogramming in Python

Just like metadata is data about data, metaprogramming is writing programs that manipulate programs. It's a common perception that metaprograms are the programs that generate other programs. But the paradigm is even broader. All of the programs designed to read, analyze, transform, or modify themselves are examples of metaprogramming.

Source: Metaprogramming in Python, an article by Satwik Kansal.

A Complete Guide to Logging in Go with Zerolog

Zerolog is a high-performance, zero-allocation Go logging library. It provides structured logging capabilities for latency-sensitive applications where garbage collection is undesirable. You can use in a completely zero-allocation manner such that after the logger object is initialized, no further objects will be allocated on the heap, thus preventing the garbage collector from being triggered.

This tutorial will explain how to install, set up, and use the Zerolog logger in a Go application. We'll start by going through its API and all the options it provides, and show how to customize them in various ways. Finally, we'll describe how to use it in a typical web application so you can get a good idea of how to adopt it in your projects.

Source: A Complete Guide to Logging in Go with Zerolog.

More Details on details

A lot of chatter around the ol’ <details> and <summary> elements lately! I saw Lea Verou recently tweet an observation about the element’s display behavior and that sorta splintered into more observations and usage notes from folks, including a revived discussion on whether <summary> should be allowed to contain interactive elements or not.

There are a lot of dots to connect and I’ll do my best here to do exactly that.

Source: More Details on details, an article by Geoff Graham.

Ship Small Diffs

I’ll make the case for one practice that works very well operationally: deploying small units of code to production on a regular basis. I think that your deploys should be measured in dozens of lines of code rather than hundreds. You’ll find that taking this as a fixed point requires only relatively simple uses of revision control.

Source: Ship Small Diffs, an article by Dan McKinley.

Locklands

Once, Sancia Grado was just a thief with a grudge and a rare talent. Then she learned how to use that talent, and beat the great merchant houses of Tevanne at their own game. With Clef and Berenice, she even saw off an immortal hierophant - but the war they're fighting now is one they know they can't win.

This time, they're not facing robber-baron elites or an immortal hierophant, but an entity whose intelligence is spread over half the globe: a ghost in the machine using the magic of scriving to possess and control not just objects, but human minds.

Despite all their efforts their enemy marches on, implacable, unstoppable - and it's closing in on its true prize: an ancient doorway that leads to the centre of creation itself.

Sancia and her friends glimpse a last desperate opportunity to stop this unbeatable foe - but to do so, they'll have to unlock the centuries-old mystery of scriving's origins and pull off the most daring heist they've ever attempted.

And as if that weren't enough, their adversary might just have a spy in their ranks - and a last trick up its sleeve . . .

In the evening I started in Locklands, book 3 in The Founders Trilogy by Robert Jackson Bennett.

Swift 5.7 Released!

Swift 5.7 is now officially released! Swift 5.7 includes major additions to the language and standard library, enhancements to the compiler for a better developer experience, improvements to tools in the Swift ecosystem including SourceKit-LSP and the Swift Package Manager, refined Windows support, and more.

Source: Swift 5.7 Released!, an article by Holly Borla.

Writing A Lisp Interpreter In Haskell

A while ago, after what now seems like eternity of flirting with Haskell articles and papers, I finally crossed the boundary between theory and practice and downloaded a Haskell compiler. I decided to do a field evaluation of the language by two means. I was going to solve a problem in a domain that Haskell is known to excel at followed by a real world problem1 that hasn't had much exploration in Haskell2. Picking the problems was easy. There's a lot of folklore that suggests Haskell is great for building compilers and interpreters so I didn't have to think long to a pick a problem that would be self contained, reasonably short, and fun - writing an interpreter of a Lisp dialect. For the second test case I decided to go with a web application - plenty of people are writing them for money and there hasn't been much Haskell-related work done in this area.

Source: Writing A Lisp Interpreter In Haskell, an article by Slava Akhmechet.

3 Common Misconceptions About Object-relational Mapping

Most software developers are familiar with object-relational mapping (ORM), a coding technique that creates an abstraction layer between object-oriented programming languages and databases. But despite its value, ORM isn’t ideal in all situations – particularly when programmers make wrong assumptions about its use. We debunk several such mistaken beliefs so that you can use ORM the right way.

Source: 3 Common Misconceptions About Object-relational Mapping, an article by Will Johnston.

What is a LSM Tree

In this post, we'll dive deep into Log Structured Merge Tree aka LSM Tree: the data structure underlying many highly scalable NoSQL distributed key-value type databases such as Amazon's DynamoDB, Cassandra and ScyllaDB. These databases by design are known to support write rates far more than what traditional relational databases can offer. We'll see how LSM Tree enables them to allow the write speeds that they claim, as well as how they facilitate reads.

Source: What is a LSM Tree, an article by Rahul Sharma.

Go Traps - nil interfaces

Go is one of the programming languages I love the most. It allows a very fast execution time (unlike Python) without affecting negatively the developer experience (unlike C), and is strongly typed (unlike TS where you can lie to the compiler). But it has some flaws, and nil interfaces are a tricky one I have to address.

Source: Go Traps - nil interfaces, an article by Ewen Quimerc'h.

The M1 iPad Pro

My iPad Mini 5 is great and I love it to bits, but I have been feeling the need for a bigger screen for a while (my high myopia offsets age-related presbyopia a bit, but every Winter I find it a little harder to look at small screens in the evenings), and even though the iPad Air might have been cheaper in a regular situation there was also a little pressure to get something that could tide me over during the looming recession.

But feature-wise, the Pro’s amazing ProMotion display and Thunderbolt support really sealed the deal.

Source: The M1 iPad Pro, an article by Rui Carmo.

Write Your Own Task Queue

This is not a tutorial on how to write your own task queue, but rather an attempt to convince you that you should write your own.

What’s a “task queue” in this context? For the purposes of this post, a task queue is a system for performing work out of band from a user interaction, often at some later time. Typically this is a core component of many web apps, and is used for performing long running tasks or things that can fail and may need to be retried like sending emails.

So, why write your own? In short: task queues have many properties and tradeoffs that make it hard to find one that fits requirements perfectly, and with the world class open-source software we have available today they can be relatively quick to write from scratch1.

Source: Write Your Own Task Queue, an article by Dan Palmer.