Underrust: What does vec![0u8; 1024] really do?

How does Rust allocate a zeroed Vec and what does it cost? | Continue reading


@darkcoding.net | 1 month ago

The memory remains: Permanent memory with systemd and a Rust allocator

A Rust object that survives program restart thanks to Rust allocators, systemd’s file descriptor store, and syscall memfd_create. | Continue reading


@darkcoding.net | 4 months ago

Epoll: The API that powers the modern internet

Linux’s epoll API solved the C10K problem, enabling fast and afforable Internet services. | Continue reading


@darkcoding.net | 1 year ago

Linux: What Can You Epoll?

On Linux what can you turn into a file descriptor and then monitor with epoll? | Continue reading


@darkcoding.net | 1 year ago

Underrust: Multiple Return Values

How does Rust return values, and does it make any difference to us programmers? | Continue reading


@darkcoding.net | 1 year ago

Overthinking Leetcode's Two Sum with SIMD

When is the linear scan Two Sum solution faster than a map? What if we use AVX-512 instructions? | Continue reading


@darkcoding.net | 1 year ago

Underrust: What is the cost of sync::Once?

In Rust, what is the performance cost of using sync::Once after the initial setup? | Continue reading


@darkcoding.net | 1 year ago

Underrust: Does it matter what type (u8, u32, ...) I use?

In Rust, how does using a different primitive type (u8, i32, u64, …) change the generated assembly? | Continue reading


@darkcoding.net | 1 year ago

The Underrust: Rust's assembly output

Assembly: In all the world of the programmer, there is no more important output. | Continue reading


@darkcoding.net | 1 year ago

A very small Rust binary indeed

Can we make a Rust program that’s as small as it’s assembler equivalent? | Continue reading


@darkcoding.net | 1 year ago

A random number you already have: The stack address

Thanks to Address Space Layout Randomization you can use the address of a stack variable as a zero-cost random number. | Continue reading


@darkcoding.net | 1 year ago

Return Value Optimization in Rust

Rust avoids memory copies by optimizing return value placement. | Continue reading


@darkcoding.net | 2 years ago

Rust atomics on x86: How and why

On x86 it doesn’t really matter what sync::atomic::Ordering you choose. | Continue reading


@darkcoding.net | 2 years ago

Rust is also C

Safety is boring, let’s do pointer arithmetic. | Continue reading


@darkcoding.net | 2 years ago

Scripting Minecraft server with Python

Minecraft has an API. If you run your own server you can program it from Python. | Continue reading


@darkcoding.net | 2 years ago

Rust Performance 101 in 5 Minutes

Is your Rust program CPU bound? Here are the very first things you can do on Linux. | Continue reading


@darkcoding.net | 2 years ago

CPU silently disappointed with your choice of instruction ordering

An adventure in CPU out-of-order instruction execution. | Continue reading


@darkcoding.net | 2 years ago

Traits: Rust's unifying concept

Rust’s traits are a single concept that unifies interfaces, abstract classes, mix-ins, operator overloading, contraints on generics, and more. | Continue reading


@darkcoding.net | 3 years ago

A day in the life of a professional software engineer

Just a normal day reversing linked lists on the whiteboard. | Continue reading


@darkcoding.net | 3 years ago

Three things I wish I’d known learning Rust

It will take longer to learn than most languages, the standard library is small so you’ll need dependencies, and a lot of behavior is in traits. | Continue reading


@darkcoding.net | 3 years ago

Quote of the day: A stirring speech

… because, at every new incident, your fortitude was to be called forth, and your courage exhibited; because danger and death surrounded it, and these you were to brave and overcome. For this was it a glorious, for this was it an honourable undertaking. | Continue reading


@darkcoding.net | 3 years ago

The simplest CLI that could possibly work

In Go, what’s the simplest possible way to put all your ad-hoc tools in one place? | Continue reading


@darkcoding.net | 3 years ago

Collect and handle multiple errors in Go

In Go, how do you run several operations that might return an error, and return those errors at the end? Here’s how I do it. | Continue reading


@darkcoding.net | 3 years ago

A Developer Goes to a DevOps Conference

As a professional software engineer and enthusiastic pro-am systems administrator, I have long been curious about DevOps. I spent the last two days at [PDX DevOpsDays]( Across organised talks, Igni… | Continue reading


@darkcoding.net | 4 years ago

A developer goes to a DevOps conference

Two days at PDX DevOpsDays, a gathering of system administrators who use version control, and write a lot of YAML. | Continue reading


@darkcoding.net | 4 years ago

Reading MediaRecorder’s webm/opus output

Javascript can now record, manipulate and play sound thanks to a whole range of audio-related API’s. One of the simpler and more useful parts of that is MediaRecorder which can record sound, typically from the user’s microphone.const stream = await navigator.mediaDevices .getU … | Continue reading


@darkcoding.net | 5 years ago

Javascript’s async/await and Promise in a few words

This is a very common pattern in Javascript: | Continue reading


@darkcoding.net | 5 years ago

Growing software, in two tweets

Gardening is my preferred metaphor for software. When I grow a new piece of software, there is a very predictable path I go through as I attempt to manage it’s complexity. It is, in fast-forward, the history of programming language design. That process is short enough to capture … | Continue reading


@darkcoding.net | 6 years ago

What Made Maddy Run

What Made Maddy Run by Kate Fagan, is a book about the importance of doing what you love, of really listening to the people close to you. | Continue reading


@darkcoding.net | 6 years ago

Learn Better – book notes

Learn Better, by Ulrich Bosner is an interesting, valuable book, that is too long. | Continue reading


@darkcoding.net | 6 years ago

systemd socket activation in Go

To start a server on a port below 1024 (i. | Continue reading


@darkcoding.net | 8 years ago

The Joy of systemd

Three years ago when I wrote The Joy of Upstart, that was the easiest way to turn your scripts into daemons. | Continue reading


@darkcoding.net | 8 years ago

How Ada Lovelace solved problems

Over 170 years ago, on Friday 21st July 1843, at 4 o’clock, Ada Lovelace was working on a mathematics problem, possibly on the first known computer program (it was written that summer). | Continue reading


@darkcoding.net | 8 years ago

Facebook’s code quality problem

tl;dr: It looks like Facebook is getting the textbook results of ignoring code quality.Update: More examples, and insights from ex-employees in the reddit discussionFacebook has a software quality problem. I’m going to try to convince you with three examples. This is important be … | Continue reading


@darkcoding.net | 8 years ago

Decrypt your HTTPS traffic with mitmproxy

tl;dr Use the mitmproxy doc, return here if trouble. | Continue reading


@darkcoding.net | 8 years ago

OSCON 2015: Impressions

I attended OSCON for the first time this year in Portland. | Continue reading


@darkcoding.net | 8 years ago

GopherCon 2015: Favorite talks

GopherCon was in Denver again this year, and a lot of fun it was, mostly the meeting of wonderful people. | Continue reading


@darkcoding.net | 8 years ago

We are Equality

When the President of the United States of America wants to send an email, we don’t close email-space, and delay your email so his very important one can go through. | Continue reading


@darkcoding.net | 8 years ago

Building shared libraries in Go: Part 2

In part 1 we called a very simple Go shared library from Python. | Continue reading


@darkcoding.net | 8 years ago

Building shared libraries in Go: Part 1

Since 1. | Continue reading


@darkcoding.net | 8 years ago

How memory is allocated

tl;dr man 2 brk | Continue reading


@darkcoding.net | 8 years ago

Go: Slice search vs map lookup

tl;dr Use a map. | Continue reading


@darkcoding.net | 8 years ago

Software engineering practices

A selection of software engineering practices, from notes I took at an XTC meetup many years ago. | Continue reading


@darkcoding.net | 8 years ago

How I read job postings

In the interests of illustrating the complicated programmer psyche for the benefit of anyone involved in recruitment, here’s the two things I look at in a job advert: | Continue reading


@darkcoding.net | 8 years ago

Go: The price of interface{}

Go’s empty interface{} is the interface that everything implements. | Continue reading


@darkcoding.net | 8 years ago

Science fiction: Ancillary Sword

It was a gesture meant to comfort. | Continue reading


@darkcoding.net | 9 years ago

Quotes from veteran software engineers

The software industry is the most fashion-conscious industry I know of. | Continue reading


@darkcoding.net | 9 years ago

Raw sockets in Go: Link layer

Continuing our dive into the Internet Protocol Suite from Go (See part 1 Raw sockets in Go: IP layer), we are going to the link layer, so we can see the IP headers. | Continue reading


@darkcoding.net | 9 years ago