实时更新 /r/rust 热门的话题。对于 Telegram 的用户可以订阅 Telgram Resource Channel 获取同样的咨询更新。
Hey everyone! A couple months ago, I published Cooked Wakers, a set of traits designed for making it easy to create
std::task::Waker objects with 100% safe Rust and without any implementation overhead. One of the frustrating things about that design is that Rust's generic monomorphization rules made it impossible to generically create a
RawWakerVTable; This meant that the
IntoWaker trait could only ever be implemented on concrete types, which meant that I had to provide a complex derive for it, rather than a generic implementation. It also meant that downstream users had to create a lot of boilerplate types wrapping
I want to praise those who work on Rust and LLVM compilers to make our Rust applications even faster to execute!
RustSec is a community database of security advisories filed against crates published to crates.io. It is maintained by the Rust Secure Code Working Group.
TL;DR: The compiler is now able to optimize much better than before.
I've implemented a Visitor and code generator which works on stable rust.
I've written Crush, a shell/programming language aimed at replacing shells like bash or fish. It has some ideas in common with nushell, but Crush focuses on being a fully featured and reasonably modern programming language with types, closures, etc.
kmon provides a text-based user interface for managing the Linux kernel modules and monitoring the kernel activities. By managing, it means loading, unloading, blacklisting and showing the information of a module. These updates in the kernel modules, logs about the hardware and other kernel messages can be tracked with the real-time activity monitor in kmon. Since the usage of different tools like dmesg and kmod are required for these tasks in Linux, kmon aims to gather them in a single terminal window and facilitate the usage as much as possible while keeping the functionality.
I'm surprised I'm writing this, but I cannot find a good debugger for Rust. I've been using VSCode as it has been the best---everything else has horribly mangled function names and whatnot. But VSCode debugging is a very broken experience. I've had issues with how it handles the embedded terminal. I'm currently having issues where code gets a segfault within the debugger which runs totally fine without it. And with the exact same code I've gotten "Inconsistency detected by ld.so: rtld.c: 1180: dl_main: Assertion" which makes the launch fail. It's like once every two weeks there's some new problem.
TinyVec is a 100% safe code alternative to SmallVec and ArrayVec crates. While SmallVec and ArrayVec create an array of unintialized memory and try to hide it from the user, TinyVec simply initializes the entire array up front. Real-world performance of this approach is surprisingly good: I have replaced SmallVec with TinyVec in
lewton crates with no measurable impact on benchmarks.