Programming · Latest articles

29 new today · 2,701 articles · from 79 blogs

Baby Steps·

Come contribute to Salsa 2022!

AI summarySalsa is an incremental computation library used by tools like rust-analyzer to stay responsive during typing, and the team is currently working on Salsa 2022, a major new revision that will make the API more natural to use. The author is calling for contributors, as the project currently lacks a large group of maintainers, and invites interested people to check the Salsa 2022 tracking issue for tasks to tackle.

Josh W. Comeau··Josh W. Comeau

Why React Re-Renders

AI summaryThis article is a tutorial explaining when and why React re-renders, noting that instead of updating the DOM directly, developers tell React what the DOM should look like and React handles the rest. It unpacks the mechanics behind React's re-rendering process. The goal is to help readers use this knowledge to optimize the performance of their React applications.

Mara Bos·

Comparing Rust's and C++'s Concurrency Library

AI summaryThe article compares Rust's concurrency library with C++'s, noting that Rust's standard library features—threads, atomics, mutexes, and condition variables—closely resemble those introduced in C++11. C++ has since gained additional concurrency features through C++17 and C++20, with more proposals for future versions. The article reviews these C++ features, discusses what Rust equivalents could look like, and what it would take to implement them.

Lea Verou··Lea Verou

On ratings and meters

AI summaryThe author explores how to build a star rating web component that is semantically appropriate, ideally building on the element, but runs into limitations like styling difficulties, Safari's lack of customized built-in element support, and closed shadow roots that prevent custom styles. After experimenting with extending , nesting one in Shadow DOM, and using ARIA roles, they settle on two components: , a discrete version of , and , an editable rating widget that inherits from it. They remain uneasy about some design trade-offs, such as breaking encapsulation to share ElementInternals and the unclear semantics of an editable meter, and share their experiments at nudeui.com.

Marc Brooker·

What is Backoff For?

AI summaryThe article explains that backoff is highly effective at handling short-term overload spikes, but only provides long-term value when it actually reduces total work—such as with a small number of serial clients whose next attempts are delayed by backing off. With large or effectively unbounded numbers of independent clients, backoff merely defers work rather than reducing it, so long-term overload requires lowering load through a proper adaptive retry policy instead. Simulation results validate these claims, showing that retry backoff has almost no effect on traffic amplification with unbounded clients but substantially improves system behavior with a limited number of serial clients.

Svelte Blog·

What’s new in Svelte: August 2022

AI summaryThis August 2022 Svelte update highlights major upcoming design changes to SvelteKit before its 1.0 release, including numerous improvements to error handling, SSR, Vite integration, and several breaking changes. It also announces new full-time maintainers joining the Svelte team, alongside community showcases, learning resources, and new libraries and tools built with Svelte.

Marc Brooker·

Getting into formal specification, and getting my team into it too

AI summaryThe author recounts how recurring, hard-to-debug state convergence bugs while working on AWS EBS led them from ad-hoc fixes through tools like Alloy and Spin to adopting TLA+ for formal specification, which they have since used across many AWS teams and helped popularize, including through the paper 'How Amazon Web Services Uses Formal Methods.' They advise anyone wanting to adopt formal specification to find a motivating example where correctness truly matters—typically tricky distributed protocols or security boundaries—and to invest the time to learn the tools, which requires some logic and set theory. Success also depends on building buy-in by recruiting teammates who have the right mix of hubris, humility, and laziness to believe correct software is achievable.

Lea Verou··Lea Verou

Help design the State of CSS Survey 2022!

AI summaryThe author is helping design the 2022 State of CSS survey, an annual feedback collection from web developers, through a Google UI fund grant, with plans to launch it in mid-September. The preliminary outline includes changes from last year's survey, such as removing the Pre-processors category and adding new CSS features like :has(), Cascade Layers, and color-mix(). Community feedback is welcome until August 20 via GitHub reactions and issues, and since browser vendors use these surveys to prioritize feature implementation, participating can help get favorite CSS features implemented faster.

brandur.org··Brandur Leach

Soft Deletion Probably Isn't Worth It

AI summaryThe article argues that soft deletion—marking rows with a deleted_at timestamp instead of hard-deleting them—causes significant problems: deletion logic leaks into every query, foreign key referential integrity is effectively lost, pruning old data for regulations like GDPR becomes painfully complex, and undeletion rarely works in practice since deletions usually have side effects in other systems that can't be reversed. The author proposes an alternative: moving deleted rows into a dedicated deleted_record table with a flexible jsonb column, which keeps normal queries clean, preserves foreign key guarantees, and makes hard deletion trivial while still retaining data for occasional inspection.

Raph Levien·

Advice for the next dozen Rust GUIs

AI summaryThe article surveys the fragmented state of Rust GUI development, where no consensus has emerged among toolkits like egui, Iced, Druid, and Slint, largely because GUI design involves a large, sensitive tradeoff space with few obviously correct choices. The author argues that "native" is a confusing term that varies by platform, and recommends instead evaluating toolkits on concrete criteria such as text rendering, input methods, accessibility, and platform integration. It also discusses infrastructure-level fragmentation around windowing libraries like winit and druid-shell, and the tradeoffs of relying on the system compositor, urging developers to carefully consider alternatives and invest in improving this shared infrastructure.

Lea Verou··Lea Verou

What is the best way to mark up an exclusive button group?

AI summaryThe author polled Twitter about the best way to mark up an exclusive button group, initially assuming radio buttons and labels were the accessibility-friendly answer. However, accessibility expert Léonie Watson argued that elements styled as buttons should behave as buttons (using aria-pressed), since mismatched expectations lead to poor UX for assistive technology users. The author then shared their implementation as a web component and pointed readers to the full Twitter thread and Léonie's blog post for further details.

Lea Verou··Lea Verou

Introducing Rety: live coding, without the stress

AI summaryThe author introduces Rety, a tool that records live coding sessions and makes them replayable, solving the problem that live-coded slides are useless without the presenter, particularly for university courses taught by multiple instructors. After test-driving it in a spring 2022 course, the author found pre-recorded Rety scripts superior to real live coding, since they allow editing, adjustable typing speed, and fewer typos while still supporting unplanned demos. Having debuted at the CSS Day conference, Rety is now released as two classes (Recorder and Replayer), with a long-term vision of standardizing the Rety script format across tools like CodePen and VS Code.

Marc Brooker·

The DynamoDB paper

AI summaryThe article discusses a new AWS DynamoDB paper presented at USENIX ATC'22 that provides a rare look at the evolution of a real-world distributed system running at massive scale, including 89.2 million requests per second during Prime Day 2021. It highlights key engineering lessons from DynamoDB's history, such as the problems caused by non-uniform workloads, its use of multi-Paxos for replication and leader election, TLA+ formal methods for verifying correctness, and the MemDS distributed cache introduced to prevent metastable failures from cache cold starts. The author recommends the paper to anyone interested in databases, distributed systems, or operating services at scale.

Josh W. Comeau··Josh W. Comeau

Statements Vs. Expressions

AI summaryThis article explains the foundational distinction between statements and expressions in JavaScript, describing how programs are composed of statements that contain slots for expressions. It explores how these two structures work and how building an intuition about them can help developers solve practical problems.

Svelte Blog·

What’s new in Svelte: July 2022

AI summaryThe July 2022 Svelte newsletter reports that about $80,000 in OpenCollective donations is being used to advance the project, including funding a paid contributor to fix SvelteKit issues ahead of 1.0. Highlights include upcoming SSR improvements up to 3x faster, a new interactive tutorial, experimental SvelteKit interoperability with Vite ecosystem tools like Vitest and Storybook, and support for streaming in endpoints. The issue also showcases community-built apps and sites, learning resources, and new libraries and tools for the Svelte ecosystem.

Lea Verou··Lea Verou

Releasing Color.js: A library that takes color seriously

AI summaryThe authors, Lea Verou and Chris Lilley, started developing Color.js in 2020 out of frustration with existing color libraries, initially as a prototype to inform a native Color API for the Web Platform that is now being incubated in the WICG. Despite never being officially announced, the npm package mysteriously gained over 6,000 weekly downloads, which convinced them the library filled a real need and prompted them to finally release it. Color.js is color space agnostic, supports many color spaces including CSS Color 4 and HDR drafts, performs proper color science (gamut mapping, chromatic adaptation, multiple DeltaE methods), and is modular, ESM-first, and tree-shakeable.

Baby Steps·

Many modes: a GATs pattern

AI summaryThe article discusses the PR opened by Jack Huey to stabilize an initial, MVP version of generic associated types (GATs) in Rust, which the author is excited about despite limited compiler support and verbose syntax. Some in the community worry that GATs make the language too complex and should instead be an internal building block for more accessible features like async functions and RPITIT. In response, the author reviewed how people are actually using GATs and wrote up several patterns, including the "many modes" pattern from the chumsky parser combinator library, cross-posting the write-up to their blog.