Notes
Local First AI 25 Nov Libraries, Models, Algorithms and Tools
Why can't we just move SQLite to io_uring?
Replacing the POSIX I/O calls with io_uring is not trivial, and applications that use blocking I/O must be re-designed for the asynchronous I/O model of io_uring. Specifically, applications now need to handle the situation of I/O submission in their control flow. In the case of SQLite, the library needs to return control to the application when I/O is in flight.
In other words: you need to rewrite a whole lot of SQLite.
Well, if you do need to have flex items inside your inline node(view)s, then now you know how to fix it. Have two spans surrounding your nodeView content, so that the browser can position your cursor there if there is a loss of content surrounding it.
Or else, if you can, just avoid it.
Steven Johnson, a writer and editorial director at Google Labs, stops by to talk about the company’s new hit NotebookLM, which uses A.I. to turn even boring PDFs, such as user manuals and Kevin’s bank records, into chatty, disturbingly good podcasts.
The idea of “buildless” development isn’t new - but there have been some recent improvements that might get us closer
Home-cooked Software and Barefoot Programmers: Maggie Appleton (Local-First Conf)
Start with offline - an amazing 13-year journey: Philip Lam (Local-First Conf)
Geoffrey Litt: Riffle - Reactive Relational State (Local-First Meetup Berlin #1)
Simple sabotage for software
Some say that chunking strategies need to be custom for every document that you process. You can use multiple strategies at the same time. You can apply them recursively over a document. But ultimately, the goal is to store the semantic meaning of a document and its constituent parts in a way that an LLM can retrieve based on query strings.
What We’ve Learned From A Year of Building with LLMs
No need to deal with the complexity of concurrent programming: locks, mutexes, atomics... any work that can be done in parallel will be done in parallel.
Merge What You Can, Fork What You Can’t: Managing Data Integrity in Local-First Software
we’ve found promising signs that the reactive relational model can help developers more easily and debug apps, produce better apps for end-users, and offers intriguing possibilites for data-centric interoperability between apps
Building AI agents with Effect by Tim Suchanek
Our prompts are moderately long, very specific, repeat key requests multiple times, and we provide examples of good answers in the prompt.
We store things in app silos without any association between things that belong together. And in turn, we lose out on all the value that comes from connecting related information.
It is more difficult to conceptualize a hierarchical document that can be any depth than it is a plain text document, a flat list of characters. Because of this, it can also be more difficult to customize editors using a hierarchical data model because the API is more complex, but ultimately it is more flexible and powerful.
Evolu creates and stores CRDT messages locally and derives actual DB from them. The most simple CRDT mutation (and the only one implemented right now) is the last write win. A CRDT message contains a table, row, column, value, and timestamp because every CRDT message has to have a timestamp to ensure globally stable ordering via hybrid logical clocks(opens in a new tab).
sqlite-vss is a new vector search and storage solution that aims to be a "happy medium" between those two approaches. Your embeddings are stored inside a SQLite database and can be queried using SQL, similar to the fts5 full-text search SQLite extension.
Read this before you accept an equity offer at a startup
A custom SQLite virtual file system and some WASM/WASI compilation magic allows to run SQLite on a Cloudflare Worker and persist it into a Durable Object.
It feels really good to have control over these code blocks. I spent a lot of time writing documentation for the Modulz products and having access to these features really help me tell a better story.
The grid-auto-flow property controls how the CSS Grid auto-placement algorithm works. In this case, the dense packing algorithm tries to fills in holes earlier in the grid.
"Imagine if you could just send it the whole “page” worth of JSON. Make an endpoint for /page/a and render the whole JSON for /page/a there. Do this for every page. Don’t force your front-end developers to send a bunch of individual requests to render a complex page."
"Until we accept that most of the industry is poorly managed and try to figure out how to solve that problem, sites and web apps won’t get better, just shinier and with more bounce.
The biggest hindrance to the web’s progress isn’t non-expert developers, tooling, libraries, Single-Page-Apps, or Multi-Page-Apps. It’s bad management."
The core insight of Figma is that design is larger than just designers. Design is all of the conversations between designers and PMs about what to build. It is the mocks and prototypes and the feedback on them. It is the handoff of specs and assets to engineers and how easy it is for them to implement them.
I'm able to use my database with the same mental model as git. For each change to my database schema, I open a deploy request. Then, I can merge those changes back into my main database branch.
A side-effect when showing scrollbars on the web is that the layout of the content might change depending on the type of scrollbar. The scrollbar-gutter CSS property —which will soon ship with Chromium — aims to give us developers more control over that.
A curated list of awesome Node.js Security resources.
Ever Wonder How Merkle Trees Work?
Snowpack, Vite, and wmr have all been enabled by native JavaScript modules (...) they wait until the browser finds an import statement and makes an HTTP request for the module. Only after this request is made will the tool apply transforms to the requested module and any leaf nodes in the module’s import tree.
"...users are prone to get the settings wrong. If the settings are wrong, in the worst case it could mean that anyone can generate valid JWTs and impersonate anyone else. This is not a beginners-level problem either, last year Auth0 had a bug in one of their products that had this very problem"
"If you have to choose, you should prioritize users with no JavaScript over users with old JavaScript"
"You can determine your requirements based on data volume, QPS, and latency, but are these the real requirements? Can you find a way to eliminate this requirement without involving the database?"
Figma is just blowing up, and for good reason. It’s good software aligned with what digital designers need. It’s fast. It’s on the web, so you can’t lose stuff and don’t need to figure out a storage strategy.
While staying aligned with authority is a prerequisite to influencing executives, there are also some new communication skills for you to develop.
"I have switched teams more often than I have had to implement an AVL tree, and you can guess which one of those two was taught in school."
"I reported the problem to Telegram security, and they said it's not an issue. If you enable the feature of making yourself visible on the map, you're publishing your home address online."
Each of these tasks involves a pretty serious level of complexity, but by using Workers, we can abstract each of them into smaller pieces of functionality, and compose powerful, on-demand, and infinitely scalable webhooks directly on the serverless edge.
(...)some real-life horror stories that illustrate the potential problems of serverless in production — and how to avoid them.
We see Durable Objects as a low-level primitive for building distributed systems. Some applications can use objects directly to implement a coordination layer, or maybe even as their sole storage layer.
It’s cool to see the tech around our job evolve to the point that we can reach our arms around the whole thing (...) when web technology becomes simple enough that people can build things from start to finish all by themselves. That’s pretty cool.
20 minutes of your time to save 7 hours for the team. Your company will make that tradeoff every day. $40 of your expensive time for $420 of everybody else's time? Yes please.
The development cost of IE11 support is high. (...) but at a minimum, you should be employing the module/nomodule differential approach for serving legacy JavaScript. This ensures you don't penalize the ~98% of your users with modern browsers for the 1-2% of IE users.
Leading-trim is a suggested new CSS property that lets us remove the extra spacing in every font so that we can more predictably style text.
(...) this has long been the worry raised by such language-generating algorithms. Ever since OpenAI first announced GPT-2, people have speculated that it was vulnerable to abuse. In its own blog post, the lab focused on the AI tool’s potential to be weaponized as a mass producer of misinformation.
TypeScript is incredibly powerful, but is often difficult to read for beginners and carries the overhead of needing a compilation step before it can run in a browser (...) Fortunately the TypeScript team has enabled a way to type check vanilla JavaScript using JSDoc.
With content-visibility, it will style and layout all of the contents that are currently visible to the user (they are on-screen). However, when processing the story that is fully off-screen, the browser will skip the rendering work and only style and layout the element box itself.
(...) Xi wants to use artificial intelligence to build a digital system of social control, patrolled by precog algorithms that identify dissenters in real time.
(...) when Cloudflare receives the first packet during TLS negotiation, we hint the Workers runtime to eagerly load that hostname’s Worker. After the handshake is done, the Worker is warm and ready to receive requests. Since it only takes 5 milliseconds to load a Worker, and the average latency between a client and Cloudflare is more than that, the cold start is zero.
"Localisation and accessibility are both hard, super important and the right thing to do and get not enough respect in development. It is incredibly rewarding to do them right and see the uptake in happy user numbers."
Five-year-old systems-programming language Rust, created by Mozilla, has hit a more positive milestone, for the first time becoming the 20th most popular language in RedMonk's rankings. Rust joined Tiobe's top 20 this June and is currently in 18th spot.
"Quickest way to burn out? Being in a job you deeply care about but had no autonomy to bring about change."
"As developers, we are often one of the last lines of defense against potentially dangerous and unethical practices.
The more software continues to take over every aspect of our lives, the more important it will be for us to take a stand and ensure that our ethics are ever-present in our code."
"Seniority isn’t about being the best coder 👩💻
If you think you should be senior because you’re a technical beast, you’re missing the point. Seniority is about experience, impact, and efficiency. Seniors are usually technicially proficient, but soft skills play a huge role"
"...the learning curve for serverless architecture is less daunting than that for typical DevOps skills — many of the elements for DevOps aren’t necessary when you adopt serverless architecture."
The notion that to be good at git, you have to get familiar with the terminal no longer applies. This was partly a UX problem and is more or less solved now, with well thought out GUIs like GitKraken and Tower.
"This use of server-side rendering followed by hydration feels like progressive enhancement, because it separates out the delivery of markup and scripts. But it’s missing the mindset.
The HTML that you initially send down the wire needs to be functional (at least at a basic level) before the JavaScript arrives."
"The only place that I’ve really seen generative design thrive is on flight booking websites. But anyone that’s used Google Flights and thought that it’d make a good design interface is out of their fucking mind."