Programming · Latest articles

30 new today · 2,702 articles · from 79 blogs

Without Boats·

Changing the rules of Rust

AI summaryThe article explains that Rust's API soundness decisions are universally binding because all APIs must conform to the same rules, which are enforced through marker traits. If a safe API could perform an operation that some types don't support, it must be bound by the corresponding marker trait; conversely, if Rust permits a behavior on all types without such a bound, then types lacking that behavior cannot exist. The author intends to illustrate this concept with three examples, only the first of which actually exists in Rust.

Marc Brooker·

Exponential Value at Linear Cost

AI summaryThe article argues that redundancy, like binary search, offers exponential value at linear cost: N independent hosts each with availability A yield system availability of 1-(1-A)^N, a principle foundational to RAID and cloud services. However, this exponential benefit collapses when failures are correlated—for example, hosting all machines in one datacenter with availability D reduces system availability to D*(1-(1-A)^N). System designers must therefore carefully ensure failure independence, since correlated failures are the kryptonite of redundancy's power.

Josh W. Comeau··Josh W. Comeau

Making Sense of React Server Components

AI summaryThis article is a tutorial about React Server Components, a new official way to run React components exclusively on the server that the React team unveiled after years of quiet research. It notes that this paradigm shift has caused considerable confusion in the React community. The tutorial aims to help readers build an intuition for how the technology works and how to take advantage of it.

Svelte Blog·

What’s new in Svelte: September 2023

AI summaryThis September 2023 Svelte update covers recent releases, including the move of svelteHTML into Svelte core (v4.2.0), SvelteKit 1.23.0–1.24.0 improvements such as URL support in the redirect function, warnings for mistyped route filenames, and the new onNavigate lifecycle function enabling view transitions. It also welcomes new Svelte Ambassadors and showcases a wide range of community-built apps, browser extensions, learning resources from contributors, and libraries/tools like Carta, Threlte 6, and drab.

Svelte Blog·

Unlocking view transitions in SvelteKit 1.24

AI summarySvelteKit 1.24 introduced a new onNavigate lifecycle hook that makes it much easier to integrate the browser's View Transitions API, enabling animated transitions between pages. The article explains how view transitions work—capturing the old page state and animating to the new one after the DOM updates—and demonstrates how to use onNavigate to call document.startViewTransition during navigation, with a graceful fallback for unsupported browsers. It also shows how the underlying code coordinates the navigation with the transition and how to customize the effect using CSS.

brandur.org··Brandur Leach

On Using Go's `t.Parallel()`

AI summaryThe article examines Go's `t.Parallel()`, which lets tests within a package run concurrently and cut the runtime of the author's large API test suite by 30-40%, though it notes the practice isn't broadly conventional—only about 1/10 of Go's own test suite uses it. It details several 'sharp edges' of parallel testing: sharing a test database safely via test transactions, resolving Postgres upsert deadlocks by switching to fixture seeding, and collating interleaved logs using `t.Logf` through a logging library shim. The author concludes that while Go's default package-level parallelism is often sufficient, adopting `t.Parallel()` early is worthwhile since retrofitting it later is harder than building it in from the start.

Marc Brooker·

On The Acoustics of Cocktail Parties

AI summaryThis article discusses William R. MacLean's 1959 paper 'On the Acoustics of Cocktail Parties,' which models how parties transition from quiet to loud once the number of guests exceeds a critical threshold: speakers raise their voices in response to background noise, which further increases the noise in a runaway feedback loop. The author draws parallels between this phenomenon and network congestion (RFC 896) and metastable failures in distributed systems, where a system remains stuck in a degraded state even after the triggering condition is removed. He argues that cocktail parties are indeed metastable, since a loud party stays loud until an external intervention like tapping a glass or a significant drop in attendance breaks the cycle.

Andrew Kelley·

So Long, Twitter and Reddit

AI summaryThe author, Zig creator Andrew Kelley, explains why he deleted his Twitter account, arguing that the platform's design promotes angry and extreme content and took an emotional toll on him, especially after Elon Musk's acquisition. He also describes closing the /r/zig subreddit in response to Reddit's API lockdown and warns that it is now run by a third party unaffiliated with Zig or the Zig Software Foundation. Going forward, he plans to focus on blogging, explore RSS readers for quality content, and stay cautious about platforms like Mastodon and Discord that may face similar 'enshittification.'

research!rsc··Russ Cox

C and C++ Prioritize Performance over Correctness

AI summaryThis article argues that modern C and C++ prioritize performance over correctness by relying on undefined behavior, which lets compilers silently eliminate or rewrite code in ways that break programmers' expectations. Examples include Clang optimizing away loops that use uninitialized variables, deleting signed-integer overflow checks (with the committee rejecting a proposal to standardize two's-complement wraparound), assuming side-effect-free loops must terminate, and treating null pointer dereferences as undefined. The author contends that lumping buggy and non-portable code together under undefined behavior was a mistake that makes it increasingly difficult to know whether a compiled program preserves the meaning of its source.