编程 · 最新文章
今日新增 29 篇 · 共 2,701 篇 · 来自 79 个博客
What’s new in Svelte: November 2021
AI 摘要The November 2021 Svelte update highlights SvelteKit reaching 80% completion, surpassing 5000 GitHub stars, and overtaking Sapper in usage, along with a reminder about the Svelte Summit on November 20th. Notable technical updates include svelte.dev now running on SvelteKit, a new enableSourcemap compiler option, SvelteKit dropping Node 12 support, and a Vite upgrade to fix runtime corruption. The post also features a large community showcase of apps, podcasts, educational content, and new libraries and tools built around the Svelte ecosystem.
Rustc Reading Club
AI 摘要The author and Doc Jones are launching an experimental Rustc Reading Club, inspired by the Code Reading Club, to help people understand how rustc works. The club will meet every other week for 90 minutes to read and discuss parts of the rustc codebase or related projects, aiming to gain a high-level understanding of the code. More complex sections may require multiple sessions.
Get a catch block error message with TypeScript
TypeScript forces you to acknowledge you can't know what was thrown making getting the error message a pain. Here's how you can manage it.
Moving faster
Serial, Parallel, and Quorum Latencies
AI 摘要The author presents a toy simulator for exploring the latency effects of serial, parallel, and quorum approaches to distributed operations, with configurable parameters for chain length, parallel chains, quorum size, and number of runs. Examples show that a 3-of-5 Paxos-style quorum can dramatically reduce tail latency compared to a length-3 chain replication system (dropping the 99th percentile from around 8s to just over 2ms), while larger quorums like 4-of-7 offer further high-percentile improvements. The simulator also reveals non-linear growth in latency for longer serial chains, inviting readers to experiment with the knobs.
Building an awesome image loading experience
How Unsplash's blurred image loading works and why I did mine differently for a more excellent experience on my site.
Dyn async traits, part 6
AI 摘要In this follow-up to his previous post on dyn async traits, the author shares a better approach to 'roll your own' boxed dyn traits, suggested by dtolnay: instead of constructing a vtable struct of function pointers, one creates a 'shadow trait' that mirrors the vtable's contents, similar to the technique used by the erased-serde crate. He also sketches out a crate he would like to see built for experimenting with this approach.
Custom properties with defaults: 3+1 strategies
AI 摘要The article explores strategies for providing default values for CSS custom properties when building customizable components with a CSS API, noting that setting defaults directly breaks inheritance and repeating fallback parameters is verbose. The author's preferred approach is 'pseudo-private custom properties,' where an internal property (e.g., --_color) is set to the exposed property with a fallback, while alternatives include using a fallback variable or @property registration—the latter being Chromium-only, global, and prone to silent conflicts. The article also showcases a pure-CSS checkbox switch built with the pseudo-private technique, which doubles as self-documentation of the component's custom property API.
Dyn async traits, part 5
AI 摘要On nightly Rust, async functions in traits can already be modeled with GATs and impl Trait, as done by the Embassy runtime and the real-async-trait crate, but this approach does not support dynamic dispatch. The author has been exploring why this limitation exists and what language primitives would need to be exposed to overcome it, and still favors stabilizing those primitives to enable experimentation. However, they realized that procedural macros could almost enable this experimentation today, though it falls short due to some obscure Rust type system rules that they have long wanted to change.
Speed matters
CTCFT 2021-10-18 Agenda
AI 摘要The next Cross Team Collaboration Fun Times (CTCFT) meeting will take place on 2021-10-18, with a theme focused on empowering and organizing contributors. The agenda includes opening remarks, a CTCFT update, a session on sprints implementing the async vision doc, a rust-analyzer talk, and an introduction to a contributor survey. Afterwards, an experimental social hour will be held with breakout rooms coordinated via the rust-lang Zulip.
How Remix makes CSS clashes predictable
Remix has this beautifully simple feature for CSS that I want to tell you all about.
0015: imp internals, reflections, precedence, make mode, mutant, q3, error recovery, tonsky ui, subtext 10, factfulness, benchmarking advice, dependency hubs, independent research, zig wayland, retool, observable dependencies, ugly buildings, without scihub, wasm virtual memory, huawei breakdown, infrastructure langauges, stencil vectors, chiX
Dyn async traits, part 4
AI 摘要This article is the fourth part of a series exploring dynamic dispatch for async traits in Rust. Building on a previous post about implementing Iterator for dyn Iterator using new primitives, the author examines what core capabilities would be required to extend the same approach to async iterator traits. The article also discusses that calling an async fn through a dyn trait requires the return type to be a Box, but only in the dyn context rather than universally.
Dyn async traits, part 3
AI 摘要This post continues a series on 'dyn async traits' in Rust, building on the idea that the compiler can be viewed as synthesizing an impl that performs dynamic dispatch. The author explores a theoretical future in which Rust programmers could manually write this 'impl Trait for dyn Trait' themselves. Though partly a thought exercise, giving programmers such control could enable many new use cases and may inform a future language design.
Introducing the new kentcdodds.com
This site just experienced a huge rewrite and I want to show you around a bit.
Dyn async traits, part 2
AI 摘要This article is the second part of a series on dyn async traits in Rust, addressing the key challenge that dyn types must specify values for all associated types. It explores how dyn traits currently work in Rust, explaining that a dyn-safe trait like DoTheThing is implemented by its corresponding dyn type. The post also examines the background behind this limitation and where it comes from.
What’s new in Svelte: October 2021
AI 摘要This October 2021 edition of "What's new in Svelte" marks one year of the monthly roundup and covers recent Svelte releases, including no-op SSR lifecycle functions and improved TypeScript integration. It also details SvelteKit's progress toward version 1.0 with nearly 100 pull requests, breaking changes, and a call for community contributors, alongside community showcases of apps, podcasts, tutorials, and new libraries. The post concludes with a call for speakers for Svelte Summit Fall 2021, scheduled for November 20.
Dyn async traits, part 1
AI 摘要The author and Tyler Mandry have been working on implementing async fn in traits in Rust, with their design thoughts collected on the async fundamentals initiative website. This blog post series focuses specifically on the challenge of combining dyn with async fn. This first post introduces the problem and the overall goal they are aiming for, though they don't yet know the best way to achieve it.