
tales, reflections, and evolving ideas.
Blog
Meta / Facebook - How a graph model can scale your relational DBs
Did you know that still, to this day, the majority of Meta's data needs are serviced by MySQL? There is a caching layer atop it (called TAO) that services all queries, sending requests to MySQL only on a cache miss but what enabled TAO and MySQ...
Do LWW Registers Need Vector Clocks or Causal Graphs? 💭
Short answer: No. When it comes to a LWW register, Lamport clocks offer all the guarantees we need. Guarantees provided by other clock types are discarded during the merge phase of LWW. A last write wins register is a register where the "last" ...
Lamport Clock 🕥
The Lamport clock was originally described in 1978 in the paper "Time, Clocks, and the Ordering of Events in a Distributed System". It is a logical clock that was created as a way to order events in a distributed system. Why not use wall/physic...
Why SQLite? Why Now? 🐇
I've been sucked down a `sqlite` rabbithole and I'm all-in on it. So why `SQLite`? And why now? For me, its about re-architecting how we write code so it can fit the coming world of edge, distributed and local-first computing. In one way, `sq...
You'll always have a body
> Prompted after reading https://www.physics.princeton.edu/ph115/LQ.pdf and https://www.quantamagazine.org/how-to-make-the-universe-think-for-us-20220531/ Sorry to break the news but even when you figure out how to upload your consciousness to ...
📚 Not Machine Readable?
Was watching https://www.youtube.com/watch?v=AHblHPLoKKE&t=139s and this dawned on me. When we say "something isn't machine readable" we're not speaking accurately. What we really mean is that the content is not readable for the way that progra...
🧶 HTML, CSS & JS. All mixed up together. This time it's different.
From time to time I run across people decrying the current state of web development with words like: > We've gone completely backwards! We've gone from separating our structure, style and logic to putting them all into the same file! inline sty...
📝 Query Planning
# Review Previously we discussed the query builder. To recap, when a user interacts with the query builder a linked list of queries is built up behind the scenes. Eaech query in the list holds a reference to the prior query and an expression ...
💨 Query Plan Optimization
This is the third part in a deep dive into Aphrodite's query layer. - [[2022-05-26-query-builder:Part 1]] we talked about the query builder - [[2022-05-26-query-planning:Part 2]] covered query plans Now we'll cover how we optimize query plans...
⛓ Query Builder
Aphrodite generates rich and type safe query builders (example) from your schemas. The query builders not only query for nodes of a given type but also traverse edges, apply filters, do pagination and more. As an example, we can traverse from ...
🪨 Chunk Iterable
Today I'll be discussing the `Chunk Iterable Framework`. This is a core component of Aphrodite and is used to speed up the processing of data returned by queries. The main idea behind a chunk iterable is to be able to iterate over some source o...
📀 Large Local Storage
Way way back in 2013 there wasn't a common way to save large blobs in all browser. Back then, all of these were true: * DOMStorage only gives you 5mb * Chrome doesn't let you store blobs in IndexedDB * Safari doesn't support IndexedDB, * IE and...
🧶 Skipping the Bundling
We're in the era of ES6 modules, esm.sh and Typescript. Do you _really_ need to spin up that webpack/snowpack/rollup/vite/parcel/_insert other bundler here_ for your small scale project? I think not. These days, module management is built righ...
😌 Simple MDX
> tldr; skip to full sample code So you want to deploy a site that uses `MDX`? Outside of using Nextjs, this process is much more difficult than it aught to be. Technically we don't even need to mess with `mdx-bundler` (see Building Wit...
🧟♂️ Memes & Themes - 1619 Project
Coincidentally I came across all of these three things below around the same time This was a good critique, from 2010: “why Avater is a truly dangerous film” https://t.co/5ZeJIWndG8— Kent William Innholt (@oerhoert) April 23, 2022 ...
🧚♂️ Past, Present, Future - Doing for Others
Our current state of affairs is almost entirely determined by those who came before us. What institutions they created, what they've invented, what infrastructure & dwellings they've built, how they've spent the resources of the society, how the...
📦 Your One Package Might Be Two
When creating a software package (or module or bundle, pick your term) for others to reuse, there's often a _second_ package in the package that developers overlook. The second package is the _interface_ package. I.e., the interface that overl...
🌅 Expressing Early Fetches - React
draft post-- Fetching early is difficult to express and get right in all places in React. This is because a lack of domain models. That everything is anemic. That we've moved business logic into display. Render-as-you-fetch rather than fetch-...
🧶 Improving Code Sharing with Yarn Workspaces
Sharing code between `JavaScript` & `TypeScript` projects has always been more trouble than it should be. Say you create a common library and you want to use it in `N > 1` of your other projects. You could publish it to `NPM` and install it li...
🌈 Understanding Color by Writing a Color Picker
@import url("/blog-assets/color-picker-from-scratch/color-field.css"); > "Programmers re-invent the wheel so they can understand how the wheel works" - unknown Why write a color picker from scratch? To understand color theory better and to...
👨💻 URLs As Display Data
I've been toying with the idea that we get something wrong when it comes to URL management and routing in single page applications (SPAs). The current state of the art in SPAs is to let the URL (the route) drive application logic. We do this by...
👀 Vision
After ~8 years working at Meta and ~15 years professionally programming post college, I'm departing the workforce to puruse my own ideas full time. ## Vision 1 > **Create software to help people think more deeply.** > Creating assisted memor...
👀 Observability Driven Development
One of the things I learned quickly while working on large scale systems at `Facebook (Meta)` was that if your tests passed but you didn't observe your system in production, you had no idea whether or not your system was actually behaving as int...
☢️ Reacting Better - Deeply Nested Update Problem
Something irks me about React. It's how inefficiently it handles deeply nested updates. React apps, like any app, will have a display hierarchy of deeply nested components. The root component being the entrypoint of the app, the leaves being t...
🧮 No, Mathematical Government is not a Logical Government
Listening to Freakonomics s11e16 there was some commentary about "if the world was run by mathematicians it'd be so logical." What an absurd statement. I'll just focus on two ways this is wrong. The first is that mathematics is irrational thro...
👐 American Spirit
> Note -- I just finished reading "Beyond Good and Evil" and was curious what something of that nature would read like if Nietzsche wrote it today. Below is that reproduction of that (me channeling my conception of Nietzsche) and not an expressi...
⛵️ Reference Equality - What is it Really?
In programming we're met with things that are completely new. Even though they're new, they're familiar enough to grasp with existing concepts. This converting the new to something familiar helps us to understand things at one level but if the ...
🧬 Missing Mutation Primitives
I’ve been developing apps for the past ~8 years that use immutable data models. For the ~7 years prior to that, using a combination of mutable, immutable and lock-free data structures. Immutable models solve endless numbers of problems but what...
Reacting Better. Intro: Anemic Models
React eschews models that have any attached functionality. The “model” for a react app is usually anemic — just a bare set of properties with no methods attached. ```typescript type Slide = { selected: boolean; embeds: Embed[]; text: stri...
Understanding Generics
```js function identity(x: T): T; ``` What is the essence of a generic? > Generics are for the **caller** rather than for what is being called. They allow the **caller** to retain type information. To retain information about types given to wh...
What if Religion is last?
The popular view of religion is as being the first development of a civilization. The thing that predates a people before they discover reason & science. What if we thought of it instead as the culmination of a civilation? A civilization's peak...
Nicolas Cage is Creating a new Movie Genre
Not many people realize this but Nicolas Cage is slowly but surely carving out and defining a whole new genre of trippy and artistic horror movies. Is he doing this intentionally or acidentally? One word to describe it? Purple. ...
Pi Cloud
With services like `Herkou`, `AWS`, `Azure` and `Google Cloud`, creating and managing your own cloud architecture may be a dying art. Some might accuse me of showing my age, like professors of old who swore that their students must learn `C` and...
The Shortest, Framework Free, TODO App
@import url("/blog-assets/todo-mvc/base.css"); @import url("/blog-assets/todo-mvc/todo.css"); **A TodoMVC App in ~200 lines of plain JavaScript and 0 dependencies.** Source: ```js const tempEl = document.createElement('div'); const ...
Reactive Markdown
@import url("/blog-assets/reactive-markdown/main.css"); Many of my blog posts contain interactive demos or content that is generated via `JavaScript`. The prose of my posts, however, is written in `Markdown`. Shuttling data back and forth f...
Volatility isn't Risk
@import url("/blog-assets/volatility-is-not-risk/style.css"); The biggest lie in investing is that volatiliy = risk. This is bogus. It misses the point of risk. Risk is about the chance of losing your principal in an investment. Volatility...
Regression to the Mean & the Gambler's Fallacy - Simulated
@import url("/blog-assets/regression-mean-vs-gambler.css"); Jump to the simulation There are two seemingly contradictory findings in statistics which apply to independent events: 1. Regression to the Mean 2. The Gambler's Fallacy **Regre...
Understanding False Positive Rate
@import url("/blog-assets/false-positive-rate.css"); Jump to the simulation Throughout the Coronavirus pandemic, the most distressing thing has been the cherry picking of statistics. Things have gotten better. Cases, deaths, and hospita...
Filter, Map, etc. vs For Each & While
I've run into the occasional programmer that finds the functional way of transforming collections (`map`, `filter`, `reduce`, `zip`, `pull`, etc.) harder to understand than the imperative style of `for`, `while` and `for-each` loops. I.e., ```...
All Things are Permitted
Its been said that _"if there is no God then all things are permitted."_ Well, that's why we have laws. Precisely because all things _are_ permitted (by nature). Murder, adultery, theft, war, etc. All of these things happen and are able to happ...
Non Conceptual Definitions
Philopsophers often question what is "art" or "love" or other words for humanity has never had a solid definition. The quest to finding a general principle which can define these words is always admirable and bears much fruit (e.g., reading Hei...
These are not types
Is an **int** a type? A **float**? A **double**? These are **storage** types, not **application level** types. For many software projects, `int`, `float`, `double`, `string`, etc. exist at the wrong level of abstraction to be conidered proper ...
Dangerous. Ideas.
"A little bit of knowledge is a dangerous thing" How do yo interpret that? * Does that mean knowledge is power and even with a little bit one can become a dangerous advesary? * Or does it mean if you only know a little, rather than a lot, you a...
I am. You are?
When we describe how we're feeling we say "I am angry", "I am upset", "I am X" But you aren't _angry_ nor _upset_. You are feeling angry or upset. Describing emotions the way we currently do is incorrect in that it equates and identifies our sta...
Typed Literals ARE Constants!
``` (option 1) display.setLayout(Layouts.FIXED); (option 2) display.setLayout('FIXED'); ``` # **Are both lines of code above using constants?** I keep getting push-back that the first line is better practice than the second line. When reviewer...
Practical Laziness in Programming
When I first heard about lazy evaluation I thought it was cool but not of much practical use. That is until I thought about it a bit harder. Laziness improves API design. I’ll illustrate with a program I wrote to convert Javadoc comments to JS...
The Almighty Function
> Objects are a poor man’s closures. Closures are a poor man’s objects. Some people say everything is an object. I used to too but these days I think everything is actually a function. 1. A map? Isn’t that just a function that maps from one va...
Oh Lisp
If you ever tell someone you like Lisp and that Lisp is a more suitable language for the work you are doing most of the time you’ll get weird looks and comments like: > “Isn’t that… old?” > > “All I know is that it has parenthesis everywhere.” ...
Inheritance, Aggregation, and Pipelines
How does one write software that can be extended? I think many developer’s first instinct is to set up some form of inheritance hierarchy. Inheritance is a step in the right direction but it is very restrictive. The problem with inheritance is...
Services and Coupling
Lines of code like: > PositionCalculator calc = new MercatorPositionCalculator(); (where **_PositionCalculator_** is an interface and **_MercatorPositionCalculator_** the implementation) have always bugged me and probably any other astute prog...
Stories
scratch.md
The Mirror Room Collection
A collection of short stories about identity and becoming.
Observations on the Sleep of Seekers
Draft. Practical advice in response to The Mirror Room collection.
The Mirror Room Collection - Audiobook
Please read the print version. The audiobook is currently many revision behind.
The Reader's Crisis
Part 5 of the Mirror Room Collection. A 21st century leftish critique.
The Paradox of Becoming
Part 4 of the Mirror Room Collection. Choice as primary.
The Meeting
Part 3 of the Mirror Room Collection. The Identities Meet.
The Mirror Room
Part 2 of the Mirror Room Collection. A mystic identity.
The Consistent Man
Part 1 of the Mirror Room Collection. A rational identity.