Programming · Latest articles
30 new today · 2,696 articles · from 79 blogs
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.
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.
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.
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.
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 v1.4 released
Elixir v1.4 brings many improvements to the language, its standard library and the Mix build tool.
DevDiary Underdash: Progressive Enhancement, Graceful Degradation and Accessibility
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.
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.
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.
How to read web specs Part IIa – Or: ECMAScript Symbols
How to read web specs Part I – Or: WebVR, how do you work?
Compositor Worklet evolves into Animation Worklet!
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.
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.
Using Quiescent States to Reclaim Memory
AI summaryThis article demonstrates how to protect a shared data structure with concurrent readers and writers in C++ without using a read-write lock, by storing an atomic pointer to the current version and letting writers publish private modified copies. To safely delete old copies that threads may still be using, it introduces quiescent state-based reclamation (QSBR), where a MemoryReclaimer invokes deletion callbacks only after every participating thread has called onQuiescentState, grouping callbacks into intervals. The author notes the technique is related to userspace RCU and was used in the Junction library to implement a scalable resizable concurrent map.
Announcing GenStage
GenStage is a new Elixir behaviour for exchanging events with back-pressure between Elixir processes. In this blog post we will cover the background that led us to GenStage, some example use cases, and what we are exploring for future relea
Elixir v1.3 released
Elixir v1.3 brings many improvements to the language, the compiler and its tooling, specially Mix (Elixir's build tool) and ExUnit (Elixir's test framework).
Introducing Multirange: A tiny polyfill for HTML5.1 two-handle sliders
AI summaryWhile reviewing recent HTML specifications, the author discovered that several slider features, such as tick labels, vertical sliders, and two-handle range sliders, are poorly or not at all implemented across browsers. Most excited about two-handle sliders enabled by the multiple attribute, they experimented with overlaying two sliders and created a tiny JavaScript polyfill called Multirange, available on GitHub. The polyfill uses CSS variables for simpler, more elegant, and customizable code, and dropped its original Bliss dependency to keep the script minimal.