dr-knz.net is my open notebook and archive of lab notes. It preserves experiments, drafts, and technical deep dives from past work. For current work, writing, and ways to engage, visit raphaelposs.com Explore the content of this site: by category, or over time.| Raphael's workbench
Markets work when buyers are well informed. The European Union’s A–G label family is a long-running, quietly radical lesson in how to make that true for everyday decisions.| Raphael's workbench
“Conservative” and “liberal” don’t forecast your business risks anymore. Grid capacity, chip supply, housing, and water do. If you’re still modeling strategy around 19th-century labels, you’re running 2025 problems on antique software.| Raphael's workbench
August’s reading trail winds from Alex Hormozi’s sales psychology to sobering AI science results: why LLMs misalign when fed mistakes, why dehumanization creeps in when we treat AIs like machines, and why the startup bubble might pop before the AI one. Plus, a Greek philosopher exiled for noticing the Earth moves. Value, hype, and hubris—served with notes in the margins.| Raphael's workbench
In Lullaby language, Jerry Weinberg reflects on these problematic words that people add to their sentences to put the listener’s mind to sleep. For example, the word “just” severely discounts the actual complexity of tasks, as in “we can automate this process, we just have to design a spreadsheet …| dr knz @ work
Networking is hard. Here’s the challenge. A structured event (say, a workshop, a lecture, a concert) is not great for networking. Good networking happens when the participants can “choose their own adventure” and connect to each other in creative ways, and spend quality time doing so—without too many …| dr knz @ work
A couple weeks ago, Cockroach Labs and I parted ways amicably. (I had been delivering engineering and leadership services to this NYC-based business.) Sensing that the end of that engagement was likely near, I had actively worked on an orderly transition over the summer, such that the separation last …| dr knz @ work
This post introduces timecond, a TypeScript library I created to represent, evaluate, and describe complex conditions on time ranges. The support for time ranges is what makes it different from many other popular time scheduling libraries that focus on events (points in time). Note In contrast to all my prior …| dr knz @ work
The elephant in the room, anno 2024, is that all meaningful interactions currently happen in group chats. People do not trust the traditional world wide web (WWW) as much as they trust content coming from their communities: WhatsApp group chats, Telegram channels or groups, Facebook pages/groups, etc. However, there …| dr knz @ work
This post explores unusual primitive constructs in programming languages, from data-like primitives to somewhat esoteric features. Unusual primitives are interesting because they indicate an attempt by the language designer to help the programmer think in a new way. Acknowledgement: This writeup is a response and followup to Hillel Wayne’s …| dr knz @ work
Once upon a time, I spent multiple months implementing a graphing calculator using GW-BASIC (manual). Would I be able to do the same more quickly and effectively today using generative AI? ❦❦❦ Let’s give it a go, using Claude AI to start: Implement a simple graphing calculator in GW …| dr knz @ work
Let us start this year with the following: Manager’s club - Mega list of 1 on 1 Meeting Questions Superficially, this list (which can also be downloaded in a structured format here) compiles questions that can be asked during periodic meetings between a manager and their reports. What I like …| dr knz @ work
Abstract In the Bubbline project we are trying to build readline-like semantics on top of Charm’s Bubbletea. As of Bubbletea v0.23, we discovered this is currently impossible to do in a way that preserves input continuity reliably across readline invocations. This result is general. Any Bubbletea-based program or …| dr knz @ work
What makes an engineering manager want to improve their people management behaviors & skills? In this document, we will look at various mechanisms through which organizations incentivize good people management, and which levers are available to reports to “manage up” and hold their managers accountable. ❦❦❦ For context, a quick aside: what …| dr knz @ work
You’re arriving here because you’ve been nominated for a Technical Leadership (TL) role in some team. Or perhaps you’re considering applying for one. Note The following document is about the experience of being a TL, and that of evolving into the TL role. It does not detail …| dr knz @ work
It’s this time of the year again! Maybe it’s called “review”, maybe it’s called “check-in”: the moment in the year where you and your manager sit down together to look at the past period, review the work you’ve done, and discuss directions for the future. In …| dr knz @ work
I published an article on the Cockroach Labs Blog: Nested transactions in CockroachDB 20.1. In this article, I explain how I implemented nested transactions and SQL savepoints in CockroachDB v20.1. Also available via the Wayback Machine.| dr knz @ work
I published an article on the Cockroach Labs Blog: Local and distributed query processing in CockroachDB. In this article, I explain the software architecture and overall mechanisms in the SQL execution engine of CockroachDB, in the code leading up to version v1.1. Also available via the Wayback Machine.| dr knz @ work
I published an article on the Cockroach Labs Blog: On the Way to Better SQL Joins in CockroachDB. In this article, I explain how I improved the first design of SQL joins in CockroachDB to support basic forms of optimizations in CockroachDB v1.0. Also available via the Wayback Machine …| dr knz @ work
I published an article on the Cockroach Labs Blog: Memory Usage in CockroachDB. In this article, I explain how I designed approximate memory usage restrictions in CockroachDB v1.0, despite the lack of allocation pools in the Go’s language runtime system. Also available via the Wayback Machine.| dr knz @ work
I published an article on the Cockroach Labs Blog: Squashing a Schrödinbug With Strong Typing. In this article, I explain how I discovered a bug in CockroachDB whose existence was enabled by Go’s lack of proper algebraic data types. Also available via the Wayback Machine.| dr knz @ work
I published an article on the Cockroach Labs Blog: Modesty in Simplicity: CockroachDB’s JOIN. In this article, I explain how I designed the first (and overly simplistic) implementation of SQL joins prior to CockroachDB v1.0. Also available via the Wayback Machine.| dr knz @ work
I published an article on the Cockroach Labs Blog: Critters in a Jar: Running CockroachDB in a FreeBSD Jail. In this article, I report on how to build and install CockroachDB on FreeBSD. Also available via the Wayback Machine.| dr knz @ work
In any comparative discussion about programming languages, the probability that the conversation will mention Brainfuck or INTERCAL approaches 1 over time. (Based on years of empirical evidence as a scientist, programmer and unix hacker.)| dr knz @ work
My friend Nathan and I published an article on the Cockroach Labs Blog: Revisiting SQL typing in CockroachDB. In this article, we explain the type system we implemented for CockroachDB v1.0’s SQL dialect. It implements a large subset of PostgreSQL’s own dialect and performs inference using a …| dr knz @ work
I published an article on the Cockroach Labs Blog: DIY Jepsen Testing CockroachDB. In this article, I report on the first testing of CockroachDB (pre-v1.0) using Aphyr’s Jepsen test suite. Also available via the Wayback Machine.| dr knz @ work
Here are some resources I found useful on the topics of teaching, writing and presenting. David R. MacIver. Warning: This blog has secret mind control powers. September 2013. Steve Losh. Teach, Don’t Tell. September 2013. Jacob Kaplan-Moss. Writing great documentation. November 2009. (Part 1: What to write; Part 2 …| dr knz @ work
On November 17th, 2012, a link to a Brainfuck interpreter written using the C preprocessor language was posted to Hacker News. In the necessary flurry of HN comments that followed, the question of CPP’s Turing Completeness came up, to be answered negatively: the proposed interpreter needs to be extended …| dr knz @ work
Two days ago I started to investigate whether C was Turing Complete. With help from two serious people also interested in the topic, I came to the preliminary conclusion that it is probably not. Here is a summary of the arguments so far. Turing Completeness is a property of languages …| dr knz @ work
Background Heat on chip Computer chips become hotter when they are used. If they become too hot, they break. Also, if they become just a little hot enough, they consume much more power to get the same amount of work done. Therefore, to protect chips and increase their power efficiency …| dr knz @ work
Twelve years ago, at my first job at a University, my supervisor told my colleague and I: “I am writing a book about finite state automata. I want an interactive tool to show people what I’m doing.” So my colleague and I built Vaucanson. During that project I discovered …| dr knz @ work
(Note: the following is a rework of the preface of my thesis [1]) When I joined the CSA group in September 2008, my supervisor Chris Jesshope tasked me thus: “We made this novel chip called a Microgrid, and we want a C compiler to program it. Do it.” This is …| dr knz @ work
The important thing in science is not so much to obtain new facts as to discover new ways of thinking about them.—-William L. Bragg There are different types of scientific writings. Some report on inventions: a concrete problem without known previous solution is described, then a solution is proposed …| dr knz @ work
Ever since I defended my thesis in September 2012, a thought had been left lingering in the epilogue of my book: that computing systems architects and designers are currently incentivized by market effects to build mostly “closed” systems that are annoying to tinker with. Besides a few exceptions like Raspberry …| dr knz @ work
Ivan Godard from Out-of-the-Box Computing is currently touring the US talking about his Mill CPU architecture, based on a new machine model called the “Belt”. I just finished watching the 2nd talk on the machine model and its realization in the processor’s micro-architecture. OotB’s contribution is a machine …| dr knz @ work
1 Opdracht Tijdens deze introductie is van je het volgende verwacht: lees dit hele document door en doe de opdrachten erin. Zorg ervoor dat je alle concepten goed doorgenomen hebt. Volg de volgende tutorials: Tutorial One, Tutorial Two, Tutorial Three, Tutorial Four, Tutorial Five, Tutorial Six. Er is geen #3 …| dr knz @ work
1 Lab notes Day 1. got a de0 nano. installed Lubuntu 13.04 in VirtualBox, 32-bit, 6GB space. tried to install the Altera Quartus II suite. Not enough space. bigger HD image: 10GB. installed the tools. Fits. tried to download/install OpenRISC tools. Not enough space. ordered external SSD drive …| dr knz @ work
I need to pick a programming language to prototype some initial ideas for my next research project, an interactive shell to program and control lightweight process networks. I initially started with Python, but I stumbled into the need for efficient and concise pattern matching on tree-like data structures, which Python …| dr knz @ work
Human beings are a disease, a cancer of this planet.—-Agent Smith, The Matrix One morning I woke up suddenly at 4am. A dream brought me An Idea, and I could not shake it away. As the hours went by, I became convinced it would make a crazy yet quite …| dr knz @ work
Introductie Open een terminal, dan vor het volgende commando uit: mkdir opdracht-JOUWNAAM Vervang “JOUWNAAM” door je naam en/of die van je werkpartner. Tip vraag een assistent voor hulp om een terminal te vinden/herkennen. om een commando opnieuw te roepen, gebruik de pijltoets naar boven. Verplaats je shell naar …| dr knz @ work
This post mirrors OCaml for Haskellers from Edward Z. Yang (2010). Note The latest version of this document can be found online at https://dr-knz.net/haskell-for-ocaml-programmers.html. Alternate formats: Source, PDF. Prologue Why write a new post when a clever reader could simply “read Edward’s post backwards”? It …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/categories-from-scratch.html. Alternate formats: Source, PDF. Prologue The concept of category from mathematics happens to be useful to computer programmers in many ways. Unfortunately, all “good” explanations of categories so far have been designed by …| dr knz @ work
This post follows up on OCaml for Haskellers from Edward Z. Yang (2010) and my own Haskell for OCaml programmers from earlier this year. Note The latest version of this document can be found online at https://dr-knz.net/rust-for-functional-programmers.html. Alternate formats: Source, PDF. Prologue Rust for C programmers …| dr knz @ work
The table Also available in PDF form. The online test A web application is available to assess your own skills according to this table for one or more programming languages. How to use this table The table characterizes the proficiency level (columns) of programmers of a particular programming language in …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/on-the-future.html. Alternate formats: Source, PDF. Prologue A famous researcher once said that a scientist should not work more than 5-6 years in the same research area. The argument had something to do with losing …| dr knz @ work
For the last 4 years I have been growing dissatisfied with the quality and contents of the BSc programs in informatics in the Netherlands. So as the engineer inside me requires, I have also thought hard to find a (putative) solution. This is the result. Program Two components: Foundations of …| dr knz @ work
Every now and then a scientist should step back from his specialization and reflect in the entire research domain around him/her. What are the big, hard problems in my general area of research? I can see a couple: Privacy and data retention: we must discover and learn how to …| dr knz @ work
Say you have invented “the next big thing”, e.g. the next C, the next operating system, the next processor, and hope your thing will shine, masses will come to it and you will be forever famous. You will invest money, time, the best engineering expertise you can get, to …| dr knz @ work
You are completing a MSc-level study and feel qualified to apply for a PhD. You are toying with the idea to apply for a PhD position in computer science in the Netherlands. Not sure whether to do it or not. Then perhaps this document will help. (disclaimer: perhaps it won …| dr knz @ work
A few months ago, I was invited to present CockroachDB to a tech consulting office in Amsterdam. The audience was welcoming and receptive. They understood, appreciated, and lauded the “flagship” features of CockroachDB: distribution, scalability, high availability, operating simplicity. Yet a question came up which I had not heard before …| dr knz @ work
When I started contributing to CockroachDB, I was foremost excited to contribute to an open source project with a strong “free as in freedom” component, which makes CockroachDB agreeably FOSS in my eyes. FOSS has a social purpose, one that supports giving others both the tools to progress forward and …| dr knz @ work
CockroachDB happens to be somewhat compatible with PostgreSQL, meaning that software written to use PostgreSQL can sometimes (often!) be used with CockroachDB without changes. Why was CockroachDB designed to be compatible with PostgreSQL? Perhaps surprisingly, the answer to this question is currently (as of early May 2018) not documented publicly …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/go-calling-convention-x86-64.html. Alternate formats: Source, PDF. Introduction This article analyzes how the Go compiler generates code for function calls, argument passing and exception handling on x86-64 targets. This expressely does not analyze how the Go …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/measuring-multiple-return-values-in-go-and-cpp.html. Alternate formats: Source, PDF. Introduction The following document investigates the performance of returning multiple values from functions in Go, and compare that to C++. This is a follow-up to the Go calling convention …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/measuring-argument-passing-in-go-and-cpp.html. Alternate formats: Source, PDF. Introduction The following document investigates the performance of passing arguments to functions in Go, and compare that to C++. This is a follow-up to an earlier article I wrote …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/measuring-errors-vs-exceptions-in-go-and-cpp.html. Alternate formats: Source, PDF. Introduction The following document investigates the performance of signalling errors from functions in Go and C++. In contrast with the previous analyses that focused on a single topic, here …| dr knz @ work
Upon our arrival in New Orleans on November 5th, 2018, my friend Nathan explained to me, with a mix of apparent excitement and apprehension: “our internal Jepsen test suite found a real consistency bug.” I replied: “This is great! This confirms yet again that good testing is actually useful! Have …| dr knz @ work
SQL defines many statements for different things: creating tables, putting data into tables, using tables, between other things. To reason about groups of statements with related behavior, the data community uses common, widely accepted acronyms to designate these groups. For example, the acronym “DDL” stands for “data definition language”, the …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/go-executable-size-visualization-with-d3.html. Alternate formats: Source, PDF. Note Erratum (2019-04-02): The increase in binary size from CockroachDB v1.0 to v19.2 is 94%/125%, not 194%/225% as initially written. The increase in source code …| dr knz @ work
Specifically, I shifted my use of Slack to become a low-volume, two-times-a-day, asynchronous, opt-in communication medium in my workflow. In doing so, I removed its essence as a chat, always-on app. I stopped using the “Slack” that my industry experiences; only its logo remains. This has had tremendous positive effects …| dr knz @ work
This week, I collaborated with my friend Martin at Daiteq to add a feature to the UT-LEON3 processor and support it in our variant of the C language called SL. In short, we extended the processors’ thread creation protocol to support a wider variety of synchronization modes, and created …| dr knz @ work
“My partner is moving for their job,” “I would like to move out of the city” or “I need to spend some time caring for my relatives,” so would the conversation often start. Then, unavoidably, “and so I am thinking about working remotely.” Then, an awkward silence. My co-workers often …| dr knz @ work
Using Emacs and advanced Emacs customization for editing Go.| dr knz @ work
I like to think about computer security as the science of how things can go wrong with computers. There is so much that can go wrong! In so many different ways! To avoid becoming overwhelmed, computer engineers need a systematic way to think about security, talk about it with each …| dr knz @ work
This blog post provides an overview of the data flows inside CockroachDB and its data security architecture. Note This post was originally published in February 2020, targeting CockroachDB v20.1. It was edited in February 2022 to reflect changes in CockroachDB v22.1. A summary of changes is available in …| dr knz @ work
Both PostgreSQL and CockroachDB provide a little-known gem when it comes to controlling incoming SQL connections: a flexible, versatile configuration DSL for client authentication. In this blog post, I will explain this configuration language, describe several common and some advanced use cases, reveal a few security pitfalls, all the while …| dr knz @ work
What is faster: a local connection over a unix domain socket, or a local TCP/IP connection with TLS encryption? To a network expert, the answer seems intuitively obvious: the unix socket. But why? And by how much? Moreover, online docs and tutorials for both PostgreSQL and CockroachDB recommend—or …| dr knz @ work
Ubuntu 20.04 LTS uses Snap to distribute certain packages by default, including Chromium. This was a mistake and yields dysfunctional systems. Here’s how to fix it. How Remove all installed snaps: for p in $(snap list | awk '{print $1}'); do sudo snap remove $p done Clean up the …| dr knz @ work
Hillel proposed on Twitter today: “Expressiveness” is how easily we can ‘do’ things in a system. “Tractability” is how easily we can assert properties on things we ‘do’. F.ex DFAs are tractable, Turing machines are expressive. The expressiveness vs tractability tradeoff is one of the most fundamental in CS …| dr knz @ work
This article explains how I stopped a software vendor and at least one of its customers from hemorraging $50K+ yearly due to unnecessary costs. ❦❦❦ A recommended best practice in Enterprise security is the “three R’s”: Repair, Repave and Rotate [1] [2] [3]. Repair means applying security patches as soon …| dr knz @ work
This writeup is part of the prologue to a series of articles that talk about the “CockroachDB errors library”, which is really a general-purpose, open source replacement for Go’s standard errors package. Consider for example the following piece of code: import "fmt" type T struct { x int } func main …| dr knz @ work
This writeup is part of the prologue to a series of articles that talk about the “CockroachDB errors library”, which is really a general-purpose, open source replacement for Go’s standard errors package. So, what are we talking about here? The basic Go error API: errors are values The Go …| dr knz @ work
Go 1.13’s standard library has adopted Dave Cheney‘s main contribution to error handling from 2015: the idea that Go error objects are structured as linked lists. Alas, this adoption created a giant gap for Go developers: it has become difficult, almost impossible, to make printing error objects …| dr knz @ work
The idiomatic way to propagate errors in Go is using the predefined type error. Yet Go’s standard library only provides very rudimentary constructors for error objects, errors.New() and fmt.Errorf(). This article introduces how the CockroachDB errors library, a drop-in replacement to Go’s own errors package, expands …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/go-calling-convention-x86-64-2020.html. Alternate formats: Source, PDF. Introduction Two years ago, this article reviewed the low-level code generation of the Go compiler, as of version 1.10. A few things have changed since, and so an …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/go-errors-vs-exceptions-2020.html. Alternate formats: Source, PDF. Introduction Back in 2018, we compared empirically the performance overheads of Go and C++ with regards to the low-level calling convention: to pass arguments, to return multiple values, and …| dr knz @ work
Note The latest version of this document can be found online at https://dr-knz.net/go-executable-size-visualization-with-d3-2021.html. Alternate formats: Source, PDF. Note After a lively discussion on Hacker News and input from Russ Cox, the conclusions in the analysis below were reworded to avoid the notion of “non-useful bytes”. The …| dr knz @ work
On September 28, 2021, Melissa Amaya and Jon Purnell from the Data & Dev podcast interviewed me and Aaron Blum, lead engineer of the security team at Cockroach Labs. The focus was to understand what it takes to start in a computer security career, either fresh out of school or via …| dr knz @ work
On September 28, 2021, Melissa Amaya and Jon Purnell from the Data & Dev podcast interviewed me and Aaron Blum, lead engineer of the security team at Cockroach Labs. The focus was to understand what it takes to start in a computer security career, either fresh out of school or via …| dr knz @ work
Ever since 2010, I have studied the “meta” of software, by studying (and thinking about) the continued dialogue between programming language designers, computer designers, and programmers. The following constitutes a snapshot of my current thinking. Epistemological context During the period 2008-2012, I was requested to help design&build programming tools …| dr knz @ work
Say, you’re tasked with onboarding a new teammate, a new co-worker. You don’t know them well yet, but you want them to become effective at what the team does, quickly. You also want to quickly shore up their confidence, if that’s also needed. How to get there …| dr knz @ work
There are more-or-less “hidden” rules on how to actively progress one’s career in a large-ish corporation. Let’s look at them here. What’s in a role A role on the workplace contains a combination of behavior, skill and responsibility. Behavior is what you actually do. Skill is what …| dr knz @ work
After reaching a certain level of seniority, it’s expected that a worker can self-direct in service of the organizational goals. This creates a situation that can be difficult to navigate: is it really self-direction if the organization decides what are the “right” and “wrong” choices in the end? Today …| dr knz @ work
In 2020, I published the following two articles: Data flows and security architecture in CockroachDB Authentication configuration in PostgreSQL and CockroachDB The original text was targeting version v20.1 of CockroachDB. This month, I have updated these two pages to reflect the improvements between v20.1 and the upcoming v22 …| dr knz @ work
This document describes why and how a tech company can offer a career path to its engineering technical leaders, that is, different tracks for “deep ICs” versus “broad ICs”. To motivate this evolution, we identify two separate pressure points: from the business, to grow an increasingly skilled and mature technical …| dr knz @ work