The case for atomic types in programming languages

Interfaces 101 : Error Handling With Go Ep. 3

Introduction In episode 2, Miki examined the impact interfaces have on the performance of a Go program. To perform this experiment, Miki invoked a type’s method in two ways: with the concrete type and as an interface function to measure the difference in execution time. The con...

Interfaces 101 : Heap Escape Ep. 2

Introduction In episode 1, Miki had two functions that performed the similar operation, but returned different types. To refactor this, Miki rewrote both functions as a generic function that allowed him to specify the type to be returned during invocation. In some cases, the comp...

Write packages, not programs

Go has a great standard library. What if we think about our work not merely as building one-off programs, but instead contributing packages to the universal Go library?

The Magic of Sampling, and its Limitations

The magic of using small samples to learn about large data sets.

What’s New in Go 1.20, Part III: Minor Standard Library Changes

Go 1.20 was released on February 1, 2023. That means it’s time for the final part of this three part look at What’s New in Go 1.20. In this part, we’ll look at some of the relatively minor changes to the standard library. Before we begin, here are two changes I won&...

C was not created as an abstract machine (of course)

An introduction to Packages, Imports and Modules in Go

This tutorial is written for anyone who is new to Go. In it we'll explain what packages, import statements and modules are in Go, how they work and relate to each other and — hopefully — clear up any questions that you have. We'll start at a high level, then work dow...

Determining missing translation keys from gettext `.po` files

If you're working with applications that require translations, you may be using gettext's .po format to store your translations. One issue I've found with this is that sometimes it can be hard to quickly audit whether there are any missing translations, especially in larger appli...

Interfaces 101 : Implementing Generics with Interfaces Ep. 1

Introduction Go interfaces are beneficial to Go developers because they: Allow interfaces to separate mechanism from behavior. Increase flexibility of function parameters. Enable mocking of function parameters. With the addition of generics in Go 1.18, interfaces can be used to...