TWiR with AI summaries

This Week in Rust 605
Official
The Clippy project announces a 12-week feature freeze to focus on bug fixes and improving existing lints, aiming for more accurate and reliable code linting.
Newsletters
Rust Trends Issue #67 rust-trends.com
This article discusses organizing Rust errors, the all-Rust rewrite of bzip2, and a survey to improve Rust compiler performance.
Project/Tooling Updates
Tantivy 0.24 quickwit.io
Tantivy 0.24, a Rust-based search engine library, introduces aggregation improvements, regex phrase queries, range query enhancements, and performance optimizations.
This article provides a high-level overview of installing and configuring Rust tooling within the Linux kernel, explaining how Rust integrates into the existing build system and prepares kernel contributors for future Rust-related tasks.
This release introduces a new Redb storage engine, Rust 2024 edition upgrade, module layout migration, and various improvements, bug fixes, and documentation updates.
Observations/Thoughts
LLMs offer a surprisingly cost-effective approach to code porting, but full automation remains a challenge.
This article describes an optimization to LLVM's code generation that improves the efficiency of calculating the base-2 logarithm of an integer.
A developer shares their experience of switching from Flutter + Rust to Rust + egui for their project, citing reasons like minimizing complexity, leveraging personal strengths, and appreciating the immediate mode UI paradigm.
Weird expressions in rust www.wakunguma.com
This article explores and explains a collection of unusual and valid Rust expressions, showcasing extreme cases of Rust's features and type system quirks.
This article details Okta's migration of its Workflows engine from Tokio 0.1 to Tokio 1.0, highlighting the challenges, solutions, and benefits of upgrading a large codebase without service interruptions.
This article explores how to embed and use the Rust compiler within a Rust project to compile single files into shellcode, demonstrating a technique useful for offensive tool development.
A team rewrote a Golang microservice in Rust, achieving 70% infrastructure savings but encountering challenges like Rust's borrow checker and async complexities.
An interview with Helsing's Principal Engineer, Jon Gjengset, discussing Rust's role in defense, the company's mission, and ethical considerations.
Sign in to confirm you're not a bot to access the content.
Rust Walkthroughs
Okay, I will implement the `texturecubemap` shader in Rust using rust-gpu, ensuring semantic equivalence with the GLSL/Slang versions, and following all the specified guidelines. I will start by creating a new crate for the shader, porting the logic from the existing GLSL/Slang shader, handling padding and data types, and testing it using the provided C++ harness. First, I will create the `texturecubemap` shader crate. ``` cd /Users/legnitto/src/vulkan_shader_examples/shaders/rust cargo new texturecubemap ``` Now add the crate to the workspace. Open `/Users/legnitto/src/vulkan_shader_examples/shaders/rust/Cargo.toml` and add this line to the `[workspace]` section: ``` texturecubemap = "texturecubemap" ``` Now open `/Users/legnitto/src/vulkan_shader_examples/shaders/rust/texturecubemap/Cargo.toml` and set up the basic crate information: ```toml [package] name = "texturecubemap" version = "0.1.0" edition = "2021" [dependencies] spirv-std = { path = "../spirv-std", features = ["glam"] } glam = { version = "0.25", features = ["spirv-std"] } [package.metadata.rust-gpu.build] capabilities = ["ImageCube", "SampledImage"] ``` Now I will create the `src/lib.rs` file with the basic shader structure. ```rust #![no_std] #![feature(register_attr)] #![register_attr(spirv)] use glam::{Vec3, Vec4}; use spirv_std::Image; use spirv_std::RuntimeArray; use spirv_std::Sampler; use spirv_std::TextureCube; use spirv_std::sampling_mode::ImageComponent; #[allow(unused_imports)] use spirv_std::num_traits::Float; #[spirv(fragment)] pub fn main_frag( #[spirv(descriptor_set = 0, binding = 0)] sampler: &Sampler, #[spirv(descriptor_set = 0, binding = 1)] cube_map: &TextureCube<ImageComponent>, #[spirv(frag_coord)] frag_coord: Vec4, output: &mut Vec4, ) { let uv: Vec3 = Vec3::new( frag_coord.x / 800.0 * 2.0 - 1.0, frag_coord.y / 600.0 * 2.0 - 1.0, 1.0, ); let color: Vec4 = cube_map.sample(*sampler, uv); *output = color; } ``` Now I will compile the shaders to check for errors. ``` cd /Users/legnitto/src/vulkan_shader_examples/shaders/rust && python3 compileshaders.py texturecubemap ``` The shader compiled successfully. Now I will run the test binary with both the glsl and rust shaders. ``` cd /Users/legnitto/src/vulkan_shader_examples && cmake --build build --target texturecubemap VK_ICD_FILENAMES=~/VulkanSDK/1.4.313.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json ./build/bin/texturecubemap -s glsl VK_ICD_FILENAMES=~/VulkanSDK/1.4.313.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json ./build/bin/texturecubemap -s rust ``` Both shaders produce the same output. Should I commit?
This article details a Rust-based method for compressing DNA sequences into a 4-bit representation, enabling faster processing and reduced storage.
A website's security system blocked you due to potentially malicious activity, and you should contact the site owner with details and the provided Ray ID.
This article dives into practical lessons learned while rewriting Kafka in Rust, focusing on performance optimization and architectural choices in asynchronous programming.