编程 · 最新文章

今日新增 30 篇 · 共 2,696 篇 · 来自 79 个博客

Without Boats·

Organizational Debt

AI 摘要This is a year-end blog post by the author, who humorously acknowledges the tradition of annual Rust project posts. While the author plans to work on several technical improvements to Rust this year, the post focuses instead on organizational debt. The author argues that the Rust project urgently needs to address this organizational debt in 2019.

Lea Verou··Lea Verou

ReferenceError: x is not defined?

AI 摘要The author recounts testing how different browsers phrase the 'x is not defined' ReferenceError, cataloging the varying message formats across Chrome, Firefox, Safari, Edge, IE, and other browsers via BrowserStack. Based on these findings, they share a regex to reliably detect this specific error in a try...catch block, while acknowledging that string-matching error messages is inherently fragile. They argue that JavaScript should adopt error codes, similar to HTTP status codes, so developers wouldn't need to rely on brittle string matching to distinguish error types.

Without Boats·

Wherefore art thou Romio?

AI 摘要The article introduces Romio, a project that ports a small part of the Tokio project to the newer futures APIs, which the author started to gain experience migrating code from the old futures API to the new one. After realizing the code could be useful to others experimenting with networking code using the new async/await syntax, the author and collaborators polished it during the RustFest Rome 'impl days'. Romio is now being released for people to experiment with.

Andrew Kelley·

Using Zig to Provide Stack Traces on Kernel Panic for a Bare Bones Operating System

AI 摘要The author describes adding stack traces to kernel panics in ClashOS, a bare bones arcade game OS for Raspberry Pi written in Zig, where the default freestanding panic handler merely hangs the CPU. By embedding DWARF debug sections into the kernel image via a linker script (which required patching an overly strict LLD check that was later merged upstream into LLVM 8), and writing glue code that maps the debug info from memory using Zig's standard library APIs, the kernel can print annotated stack traces on panic. Finally, the kernel's own source files are included in memory so panic output can display the corresponding source lines.

Without Boats·

Making progress in await syntax

AI 摘要The article discusses the still-unresolved question of the final syntax for the await operation in Rust's async/await feature. In the current implementation, awaits are written through a compiler plugin, as in 'await!(bar())'. This choice is not due to any technical limitation, but simply because the precise, final syntax has not yet been decided.

Without Boats·

Anchored and Uniform Paths

AI 摘要The article discusses a major pending decision for Rust 2018 concerning the modules and paths system. The language team plans to implement an idea called '1path,' which would ensure that paths are interpreted consistently no matter where they appear in a project, whether in a use statement or in normal code.