345 private links
A small and efficient link with text fragment
For instance, in Go, there is a context.Context value, which manages timeouts, cancellation, and a small amount of data that can be threaded through various functions. It is, by design, intended to be something passed through functions even if the receiver doesn’t use it directly but only passes it along.
Rust, Haskell, all programming languages I know have colored functions.
For a “normal” change, it only propagates to the caller. It may then chain to its caller. If it propagates all the way up to the top-level function, as demonstrated in the diagram, this may seem like a distinction without a difference.
I think with some current changes to Zig a function that does IO either is or is not a color depending on which Io value you pass to it, or perhaps rather, the color is an attribute of the Io value rather than the function itself.
Rust, Haskell and all programming languages supporting async. Async is assumed to be a color because it forces to change all functions using an async function.
a color must have this characteristic where it jumps over intervening calls and forces the change on all other functions within the relevant island of color.
See the related post https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
From one minutes to 400ms
I tried this pattern but ended up fighting lonely exceptions
A weak object doesn't prevent the garbage collector to remove the object from memory. It can be useful to keep track of objects during the program lifetime (or a request handling from example).
In this post, I’ll walk through a set of common misconceptions that drive teams to introduce new infrastructure when they don’t need to. All of these can be solved with vanilla PostgreSQL 18 using standard extensions available on RDS, with no special infrastructure and no distributed-systems cosplay.
The database can be used for many things people often miss:
- user roles (finance) for modularity. In particular, a proper role can be used for defining very precise interfaces on top of database objects
- domains can be defined as an application of the abtract data type to database management
- a table for transfers can be stored with a system-time temporal table
- account audits (store old versions for logs)
- transaction state machine with functions
- record size estimation
- Heap-Only Tuple to avoid write amplification when primary keys are aligned with immutable columns. It enables faster updates. See https://ebellani.github.io/blog/2026/all-you-need-is-postgresql/#introduction:~:text=Enabling%20HOT%20Updates%20for%20Transfers,-By
- excellent OLTP (quick read and write individual rows) with a primary key reflecting the access pattern
- view to reuse queries from multiple tables
- excellent OLAP: large volumes of data while allowing quick query response times: a
finance.balance_ledgertable stores a snapshot of both balances after every transaction. - incremental maintenance via triggers
- correct isolation with
alter role finance set default_transaction_isolation = 'serializable';. If a cyclic transaction is detected, then one of the transaction fails. The application must be prepared to retry aborted transactions, but the invariants are never violated.
Key takeaways:
- 766 TPS overall with 0 failed transactions. The startup target of 10,000 transfers/day is ~0.12 TPS. We exceed that by over 6,000x, confirming massive headroom on modest hardware.
- 0 serialization failures: Despite 10 concurrent clients writing to 100 accounts under SERIALIZABLE isolation, no transactions were aborted. The working set is distributed across enough accounts that write contention is negligible at this scale.
- 8ms average read latency: The UNION ALL view over 4 tables plus the balance ledger lookup completes well within interactive response time, even as the tables grow throughout the 60-second run.
- 33ms average write latency: Each write transaction exercises the full constraint set that implements complex business logic (audit trails, time constraints, balances, etc) all within 33ms. This is the true cost of enforcing every business rule at the data level, and it is more than acceptable.
The full SQL is provided at the end.
Different algorithms can be used:
Full jitter:
sleep = random(0, min(cap, base * 2 ** attempt)
Equal jitter:
temp = min(cap, base * 2 ** attempt)
sleep = temp / 2 + random_between(0, temp / 2)
Decorrelated Jitter (based on the last sleep value):
sleep = min(cap, random_between(base, sleep * 3)It shows how using RAM efficiently can increase performance.
@media (scripting: enabled) and @media (scripting: none)
There's also an initial-only value, which is for scripting that is enabled during page load but not after
Before this feature, one approach for detecting JavaScript support was by setting a custom selector on the opening html tag—a common one seen in the wild is the no-js class name.
There are cluster wins:
- i18n: Intl.RelativeTimeFormat, Intl.PluralRules, Intl.NumberFormat, Intl.DurationFormat, Intl.ListFormat
- HTTP Clients: fetch can be used instead of axios. Limitations:
fetchdoesn't reject on HTTP errors, no interceptors, no automatic retries, no upload progress. - UI Primitives:
<dialog> - Lodash utilities
- sometime in the future: Temporal
A recap of the font specification.
With
text-box-trimwe gain control over which boundary line text boxes are cropped to, and finally we can trim away this extra space to work with a font’s actual visual height.One of the most common use cases for a lot of us is visually centering text within elements like buttons or notifications. This is especially handy for fonts that have awkward spacing like Josefin Sans.
There are plenty of creative uses [...] I placed headings with their baseline flush against sections below using negative margins. [Using text-box-trim remove the use of margins and put the heading just on the line of the next section, https://quarterre.com/studio]
Another example is to put the line on the font baseline like https://www.wepioneer.co/
[class^="btn-"],
[class*=" btn-"]
works but it is 20 times slower (3ms per frame).
It uses the :highlight() selector instead of spans.
CSS.highlights.set(category, textRanges) is used to higlight the code blocks.
Instead of doing a single join, an innocent looking for loop can end up doing tons and tons of separate queries, resulting in much slower execution.
The 1+N problem occurs if a database request is made for every item returned by the first query.
The programming language Arcadia doesn't have recursion or loops, so the problem can not exist.
A track of the timezones with their name, description and alias