Links for December 2023
Mon Jan 01 2024E.W.Ayers
1. Programming
Thanks to this I learnt about mutable value semantics. What a lovely way to think about assignments. I'm inspired to write more on this.
I read up on CouchDB and I liked what I read. I'm particularly interested in the conflict resolution protocol. I feel like the docs are not thorough and left me with lots of questions.
I've just learnt about ImGui. There is a demo of the Tracy Profiler in the browser using WebGL and it's so unbelievably responsive compared to any other system. I want to throw away all my JavaScript and DOM and use it instead of the browser stack. Compare this to the garbage webapps we have to use these days it makes me want to cry. There has to be a better way of writing webapps that aren't clunky. Seems like a similar opinion is held by the Zed team. A minimal ImGui web project (live demo).
The idea of 'immediate mode GUIs' seems to originate with Casey Muratori
I spent some time reading this paper on differential dataflow, but I came away feeling like I hadn't learnt anything to improve my life with databases.
1.1. Even more Browser sync engines
PouchDB looks alive. Uses the CouchDB sync protocol
RxDB, github looks alive
WatermelonDB, github looks dead
PartyKit hosts 'multiplayer rooms' serverlessly
I had a good debate at work about how these sync-the-database approaches (instead of having a traditional API) seem good in theory but they fall over if you have a large product. This is because
You very rarely want to sync the entire database. Even usecases that seem small can become unmanageable after a few years of use. (eg Slack chat history)
The order in which you sync the data can't be neglected: you often need to paginate or virtualise UI over views.
By syncing the database, you now need the database to be both your source-of-truth and API. The two things are coupled. If you want to change one you have to change the other which can become a migration nightmare if you have a large app or multiple products using the same db.
It's also a brainteaser doing security and consistency: You end up needing a user-action application-model anyway.
How do you handle derived data that needs some external service to compute?
I think you can solve these, but not without a lot of extra work:
The source-of-truth is event-sourced user actions.
Rather than syncing the whole DB, you write a set of views that your client needs. These are materialised on the client in their db. Now if you change the underlying datamodel the views can be updated.
If the user performs an atomic action, you send the action to the server and also perform a client-side-prediction of how the action affects your materialised views. When the authoritative server-side update from the action streams down you revert the prediction.
All of these need to work when you are offline.
All of these need to work if the db is massive and firehosing changes.
Now the challenge has shifted to being about making sure these materialised views are synced. When we eventually figure out how to do all that; I worry we will have reinvented an API and Redux.js.
2. Products
I got a PlayDate console. It's great fun. I am looking forward to attempting to make a game for it using Zig. The screen is fantastic. I wish I could have a phone with a capacative version of this screen.
Looks like Google killed Jamboard: the alternatives I found were Excalidraw, TLDraw (OSS). Figma looks fine if you have the licence. I've tried using Lucidchart and Miro but they are laggy and overkill.
People keep pointing me at Together AI as the hot new model inference hosting service.
3. Other links
Our Incredible Journey, a rant on how great products just get deleted when the company gets aquihired. It has a broader impact that this behaviour is normalised: if I see a cool new product (eg Rows), I am reluctant to invest serious time using it because it could get rug-pulled. Particularly if the product only has value when used over a large span of time. Figma almost got aquired by Adobe, would they rugpull Figma?
Don't separate names from authority. I think the point here is that you want your naming scheme (ie naming files, processes) to match the authorization heirarchy, so then checking permissions becomes about checking the name rather than looking up the permission in some complicated database.
UK National Grid Dashboard looks great! So many doomers about UK energy but we are >50% renewable now! There was so much wind power on the 21st some people got paid to use electricity. This website tracks UK energy price distribution for Octopus Energy's variable tariffs.