Latest articles

431 new today · 7,328 articles · from 241 blogs

Lea Verou··Lea Verou

Duoload: Simplest website load comparison tool, ever

AI summaryThe author needed a simple tool to compare the loading progression of two websites side by side, and after finding that tools suggested on Twitter were too complicated and unlikely to work with local URLs, they quickly built Duoload themselves. The minimalist tool's small codebase is available on GitHub, though the author cautions it is somewhat inaccurate and not suitable for mission-critical performance comparisons. The name 'Duoload' was coined by Chris Lilley.

Andrew Kelley·

Zig Programming Language Blurs the Line Between Compile-Time and Run-Time

AI summaryThe article explains how the Zig programming language centers on whether an expression is known at compile-time, introducing comptime parameters (used to implement generics via compile-time duck typing, similar to C++ templates), comptime variables, and comptime expressions. These features let the same function be evaluated at both compile-time and run-time without modification, enabling compile-time code execution like implicitly inlined if and loop constructs, complex static data initialization, and catching errors such as undefined behavior or infinite recursion during compilation. The compiler enforces limits on compile-time evaluation (such as a 1000 backward branch quota adjustable via @setEvalBranchQuota), and this approach provides expressiveness that in other languages requires macros, code generation, or preprocessors.

Without Boats·

Handshake Patterns

AI summaryThe article addresses the challenge of defining a 'handshake' protocol between two traits, Alpha and Omega, so that any type implementing Alpha can be composed with any type implementing Omega. For instance, if Foo and Bar are Alphas and Baz and Quux are Omegas, each Alpha should work with each Omega. The author emphasizes that achieving this kind of cross-trait composability is not a trivial problem.

Andrew Kelley·

Troubleshooting a Zig Regression with apitrace

AI summaryThe author rewrote the Zig compiler to insert an intermediate representation stage, which caused a Tetris game used for testing to break visually. By comparing OpenGL traces with apitrace, they traced the bug to how the compiler emitted compile-time constant arrays, where a pointer to the array's first element did not reference the data contiguously. They fixed the issue by updating constant arrays to refer to their parent data structures, added a test case, and got the game working again.

research!rsc··Russ Cox

Go and Dogma

AI summaryThe author observes that discussions among language designers and implementers, including those about Go, are rarely dogmatic because they remember weighing good arguments on both sides of each decision. In contrast, language users sometimes argue zealously as if design choices were infallible, likely because they lack that experience of evaluating trade-offs. He urges the Go community to explain engineering reasons fairly—including the case for alternatives—and to avoid argument by authority, since no decision in Go is wisdom received on stone tablets.

Elixir Blog··José Valim

Elixir v1.4 released

Elixir v1.4 brings many improvements to the language, its standard library and the Mix build tool.

Without Boats·

The Rust module system is too confusing

AI summaryThe author tweeted about an idea concerning Rust's module system, which sparked a spirited discussion about the system's pain points, including debate over whether such pain points exist at all. The author notes that the full Twitter discussion may be difficult to read depending on how well one can navigate Twitter's UI.

Lea Verou··Lea Verou

Resolve Promises externally with this one weird trick

AI summaryThe article explores how to resolve a JavaScript Promise from outside its constructor, which is normally impossible for architectural (throw safety) reasons. The author experiments with approaches like getter/setter tricks before settling on a simple, reusable defer() function that attaches resolve() and reject() methods directly onto the Promise object, allowing external code to resolve it cleanly.

Lea Verou··Lea Verou

URL rewriting with Github Pages

AI summaryThe author, a big fan of GitHub Pages for static hosting, wanted clean custom URLs (like play.csssecrets.io/pie-animated) for a book companion site without using server-side code. They discovered that GitHub Pages serves a custom 404.html for any nonexistent URL, so they used vanilla JavaScript in that file to read the requested path, look up the slug in a JSON mapping file, and redirect to the correct destination (such as a dabblet demo). The author notes this client-side URL rewriting hack could enable proper URLs for single-page sites and many other uses.

Distill·

How to Use t-SNE Effectively

Although extremely useful for visualizing high-dimensional data, t-SNE plots can sometimes be mysterious or misleading.

Andrej Karpathy·

A Survival Guide to a PhD

AI summaryThis article is a retrospective survival guide for PhD students, drawing on the author's experience in computer science and machine learning research. It weighs the benefits of a PhD (freedom, ownership, expertise, personal growth) against its downsides (intense work, stress, and identity crises), advises that strong reference letters are by far the most important factor for admission, and recommends choosing a top school with multiple potential advisers in a good physical environment. It also frames the adviser-student relationship as a symbiosis, highlighting key differences between hands-on pre-tenure advisers and more hands-off, senior post-tenure advisers.

Lea Verou··Lea Verou

Autoprefixing, with CSS variables!

AI summaryThe article describes a CSS trick that uses custom properties (CSS variables) to automatically handle vendor prefixes: you set a variable like --clip-path to initial on all elements via the * selector, and map every property variation (e.g., -webkit-clip-path and clip-path) to var(--clip-path). After this setup, you only need to set the variable, and the value cascades to all prefixed and unprefixed versions of the property, while explicit overrides still work because the * rule has zero specificity. The main drawback is that browser support is limited to the intersection of the feature and CSS variables support, which at the time excluded only Edge.

Lea Verou··Lea Verou

Markapp: A list of HTML libraries

AI summaryThe author created MarkApp, a website that lists and promotes JavaScript libraries with HTML APIs—libraries that can be used without writing any JavaScript. This addresses the problem that many HTML & CSS authors are not comfortable writing JS and struggle to use JavaScript libraries. Since the list is currently short, the author encourages readers to add any libraries with good HTML APIs they know of.