if material.is_solid() && self.voxel_count > 1 {
let center = self.svo.size as f32 / 2.0;
let removed_pos = Vec3::new(
x as f32 - center,
y as f32 - center,
z as f32 - center
);
// Incremental CoM update: new = (old * old_count - removed) / new_count
let old_count = self.voxel_count as f32;
let new_count = (self.voxel_count - 1) as f32;
self.center_of_mass = (self.center_of_mass * old_count - removed_pos) / new_count;
self.voxel_count -= 1;
}
material
}
For explosions where you remove hundreds of voxels at once, incremental updates would accumulate floating point error. So I just recalculate from scratch:
let mut com_sum = Vec3::ZERO;
let mut count = 0u32;
for (x, y, z, mat) in asteroid.svo.iter_voxels() {
if mat != VoxelMaterial::Empty {
com_sum += Vec3::new(
x as f32 - svo_center,
y as f32 - svo_center,
z as f32 - svo_center,
);
count += 1;
}
}
asteroid.center_of_mass = com_sum / count as f32;
# Mesh Generation: Only Exposed Faces
You don't want to render faces between adjacent solid voxels. For each voxel, check its 6 neighbors and only emit faces where the neighbor is empty:
for (x, y, z, material) in self.svo.iter_voxels() {
let neighbors = [
(1i32, 0i32, 0i32, [1.0, 0.0, 0.0]), // +X
(-1, 0, 0, [-1.0, 0.0, 0.0]), // -X
(0, 1, 0, [0.0, 1.0, 0.0]), // +Y
(0, -1, 0, [0.0, -1.0, 0.0]), // -Y
(0, 0, 1, [0.0, 0.0, 1.0]), // +Z
(0, 0, -1, [0.0, 0.0, -1.0]), // -Z
];
for (i, (dx, dy, dz, normal)) in neighbors.iter().enumerate() {
let nx = x as i32 + dx;
let ny = y as i32 + dy;
let nz = z as i32 + dz;
let neighbor_solid = /* bounds check && svo.is_solid(...) */;
if !neighbor_solid {
// Emit this face's 4 vertices and 2 triangles
}
}
}
I also compute per-vertex ambient occlusion by checking the 3 neighbors at each corner. It makes a huge visual difference for basically no runtime cost.
# Putting It Together
The full detonation flow:
1. Find all attached explosives
2. For each: extract debris chunks, remove voxels from parent
3. Run connected components on the damaged parent
4. Recalculate CoM and mass for parent
5. Queue mesh regeneration (happens on background thread)
6. Spawn debris entities with inherited physics
7. Add 3 second collision cooldown so debris doesn't immediately bounce back
The collision cooldown is a bit of a hack but it prevents physics instability when chunks spawn overlapping their parent.
# What I'd Do Differently
The octant-based debris grouping works but sometimes produces weird shapes. A proper k-means clustering or marching cubes approach would give nicer chunks. Also my connected components check iterates all voxels which is O(n), could probably use the SVO structure to skip empty regions.
But honestly? It works, it's fast enough, and explosions feel good. Sometimes good enough is good enough.
You can follow/wishlist Asteroid Rodeo[ here.](https://asteroidrodeo.leadbooster.co)
https://redd.it/1pzwavt
@r_rust
let center = self.svo.size as f32 / 2.0;
let removed_pos = Vec3::new(
x as f32 - center,
y as f32 - center,
z as f32 - center
);
// Incremental CoM update: new = (old * old_count - removed) / new_count
let old_count = self.voxel_count as f32;
let new_count = (self.voxel_count - 1) as f32;
self.center_of_mass = (self.center_of_mass * old_count - removed_pos) / new_count;
self.voxel_count -= 1;
}
material
}
For explosions where you remove hundreds of voxels at once, incremental updates would accumulate floating point error. So I just recalculate from scratch:
let mut com_sum = Vec3::ZERO;
let mut count = 0u32;
for (x, y, z, mat) in asteroid.svo.iter_voxels() {
if mat != VoxelMaterial::Empty {
com_sum += Vec3::new(
x as f32 - svo_center,
y as f32 - svo_center,
z as f32 - svo_center,
);
count += 1;
}
}
asteroid.center_of_mass = com_sum / count as f32;
# Mesh Generation: Only Exposed Faces
You don't want to render faces between adjacent solid voxels. For each voxel, check its 6 neighbors and only emit faces where the neighbor is empty:
for (x, y, z, material) in self.svo.iter_voxels() {
let neighbors = [
(1i32, 0i32, 0i32, [1.0, 0.0, 0.0]), // +X
(-1, 0, 0, [-1.0, 0.0, 0.0]), // -X
(0, 1, 0, [0.0, 1.0, 0.0]), // +Y
(0, -1, 0, [0.0, -1.0, 0.0]), // -Y
(0, 0, 1, [0.0, 0.0, 1.0]), // +Z
(0, 0, -1, [0.0, 0.0, -1.0]), // -Z
];
for (i, (dx, dy, dz, normal)) in neighbors.iter().enumerate() {
let nx = x as i32 + dx;
let ny = y as i32 + dy;
let nz = z as i32 + dz;
let neighbor_solid = /* bounds check && svo.is_solid(...) */;
if !neighbor_solid {
// Emit this face's 4 vertices and 2 triangles
}
}
}
I also compute per-vertex ambient occlusion by checking the 3 neighbors at each corner. It makes a huge visual difference for basically no runtime cost.
# Putting It Together
The full detonation flow:
1. Find all attached explosives
2. For each: extract debris chunks, remove voxels from parent
3. Run connected components on the damaged parent
4. Recalculate CoM and mass for parent
5. Queue mesh regeneration (happens on background thread)
6. Spawn debris entities with inherited physics
7. Add 3 second collision cooldown so debris doesn't immediately bounce back
The collision cooldown is a bit of a hack but it prevents physics instability when chunks spawn overlapping their parent.
# What I'd Do Differently
The octant-based debris grouping works but sometimes produces weird shapes. A proper k-means clustering or marching cubes approach would give nicer chunks. Also my connected components check iterates all voxels which is O(n), could probably use the SVO structure to skip empty regions.
But honestly? It works, it's fast enough, and explosions feel good. Sometimes good enough is good enough.
You can follow/wishlist Asteroid Rodeo[ here.](https://asteroidrodeo.leadbooster.co)
https://redd.it/1pzwavt
@r_rust
Steampowered
Asteroid Rodeo on Steam
Tame spinning asteroids with harpoons and thrusters. Mine them for profit. Upgrade your ship. A physics sandbox where every rock fights back.
Polynomial Regression crate (loess-rs) now available
Hey everyone. Just wanted to announce that a fully featured, robust, and solid Polynomial Regression (LOESS) crate has been released for Rust, available at loess-rs.
It is 3-25x faster than the original Fortran implementation by Cleveland (available in base R and Python scikit-misc package), and is as accurate (and even more robust) than the original implementation + offers a TON of new features on top of it: confidence/prediction intervals, cross-validation, boundary padding, different robustness weights, different kernels, ...
This is genuinely the most robust, the most flexible, and the fastest implementation of this frequently used algorithm in data science.
I believe Rust offers a perfect environment for implementing data science/bioinformatics algorithms, and I hope my crate contributes to the growing interest and usage by the community 🙌
https://redd.it/1q068hj
@r_rust
Hey everyone. Just wanted to announce that a fully featured, robust, and solid Polynomial Regression (LOESS) crate has been released for Rust, available at loess-rs.
It is 3-25x faster than the original Fortran implementation by Cleveland (available in base R and Python scikit-misc package), and is as accurate (and even more robust) than the original implementation + offers a TON of new features on top of it: confidence/prediction intervals, cross-validation, boundary padding, different robustness weights, different kernels, ...
This is genuinely the most robust, the most flexible, and the fastest implementation of this frequently used algorithm in data science.
I believe Rust offers a perfect environment for implementing data science/bioinformatics algorithms, and I hope my crate contributes to the growing interest and usage by the community 🙌
https://redd.it/1q068hj
@r_rust
crates.io
crates.io: Rust Package Registry
KHOJ : Rust based Local Search Engine
I have written a rust based local search engine Khoj
the numbers seem to be decent :
=== Indexing Benchmark ===
Indexed 859 files in 3.54s
Indexing Throughput: 242.98 files/sec
Effectively: 23.1 MB/sec
=== Search Benchmark ===
Average Search Latency: 1.68ms
=== Search Throughput Benchmark (5s) ===
Total Queries: 2600
Throughput: 518.58 QPS
What else should i change before publishing this as a package to apt/dnf?
And is it worth adding to resume?
https://redd.it/1q08drx
@r_rust
I have written a rust based local search engine Khoj
the numbers seem to be decent :
=== Indexing Benchmark ===
Indexed 859 files in 3.54s
Indexing Throughput: 242.98 files/sec
Effectively: 23.1 MB/sec
=== Search Benchmark ===
Average Search Latency: 1.68ms
=== Search Throughput Benchmark (5s) ===
Total Queries: 2600
Throughput: 518.58 QPS
What else should i change before publishing this as a package to apt/dnf?
And is it worth adding to resume?
https://redd.it/1q08drx
@r_rust
GitHub
GitHub - shankeleven/khoj: local search engine
local search engine . Contribute to shankeleven/khoj development by creating an account on GitHub.
size_lru : The fastest size-aware LRU cache in Rust
https://crates.io/crates/size_lru#zh
https://redd.it/1q02tls
@r_rust
https://crates.io/crates/size_lru#zh
https://redd.it/1q02tls
@r_rust
crates.io
crates.io: Rust Package Registry
Announcement: aselect! - an alternative to tokio::select
https://github.com/avl/aselect
The tokio
1. When one arm completes, all the other arms are canceled
2. When used in loops, if a handler runs async code, other arms are starved
aselect avoids these pitfalls by never canceling futures, and never starving them. The crate has not seen production use, so there could be bugs.
Feedback and suggestions welcome! Will something like this make async rust less error prone?
https://redd.it/1q0aig1
@r_rust
https://github.com/avl/aselect
The tokio
select! macro has two characteristics that can make it error-prone:1. When one arm completes, all the other arms are canceled
2. When used in loops, if a handler runs async code, other arms are starved
aselect avoids these pitfalls by never canceling futures, and never starving them. The crate has not seen production use, so there could be bugs.
Feedback and suggestions welcome! Will something like this make async rust less error prone?
https://redd.it/1q0aig1
@r_rust
GitHub
GitHub - avl/aselect: Less error-prone (in some ways) alternative to tokio::select
Less error-prone (in some ways) alternative to tokio::select - avl/aselect
Launched Apache DataSketches Rust
https://github.com/apache/datasketches-rust
https://redd.it/1q051s0
@r_rust
https://github.com/apache/datasketches-rust
https://redd.it/1q051s0
@r_rust
GitHub
GitHub - apache/datasketches-rust: A software library of stochastic streaming algorithms, a.k.a. sketches.
A software library of stochastic streaming algorithms, a.k.a. sketches. - apache/datasketches-rust
Create a Rust tool bfinder to find the top largest files.
I Built this rust tool which uses multi-threading to find the largest files fast. https://github.com/aja544/bfinder
Statistics:
Files scanned: 524013
Directories scanned: 124216
Errors: 0
Time elapsed: 4.380s
https://redd.it/1q0b1rz
@r_rust
I Built this rust tool which uses multi-threading to find the largest files fast. https://github.com/aja544/bfinder
Statistics:
Files scanned: 524013
Directories scanned: 124216
Errors: 0
Time elapsed: 4.380s
https://redd.it/1q0b1rz
@r_rust
GitHub
GitHub - aja544/bfinder: A rust based tool to finde the largest files
A rust based tool to finde the largest files. Contribute to aja544/bfinder development by creating an account on GitHub.
I built sockudo-ws: A WebSocket library faster than uWebSockets (C++) with HTTP/2, HTTP/3, and io_uring support
Hey r/rust! I'm excited to share **sockudo-ws**, an ultra-low latency WebSocket library I've been working on for high-frequency trading and real-time systems.
## The Big Win
We're now **~17% faster** than the next fastest Rust WebSocket library, and we actually **match or beat uWebSockets** (the C++ industry standard) in throughput benchmarks:
| Library | Total Time (100k msgs) |
|---------|------------------------|
| **sockudo-ws** | **10.2ms** |
| fastwebsockets | 12.0ms |
| tokio-tungstenite | 34.8ms |
Against uWebSockets, we're achieving 1.02-1.03x their throughput across various workloads while providing a safe, ergonomic Rust API.
## What Makes It Fast?
- **SIMD acceleration** (AVX2/AVX-512/NEON) for frame masking and UTF-8 validation
- **Zero-copy parsing** - direct buffer access without intermediate allocations
- **Write batching (corking)** - minimizes syscalls via vectored I/O
- **Zero-copy API** via `RawMessage` that avoids String allocation for text messages
## Modern Protocol Support
This is where things get interesting. sockudo-ws supports not just HTTP/1.1, but:
- **HTTP/2 WebSocket** (RFC 8441) - multiplexed streams over a single connection
- **HTTP/3 WebSocket** (RFC 9220) - WebSocket over QUIC with 0-RTT and no head-of-line blocking
- **io_uring** - Linux kernel-level async I/O that can be combined with any protocol
The best part? **All transports use the same API**. Your WebSocket handler code works identically whether you're using HTTP/1.1, HTTP/2, HTTP/3, or io_uring underneath.
## Production Ready
- ✅ **Autobahn compliant** - passes all 517 test suite cases
- ✅ **permessage-deflate** compression
- ✅ **Split streams** for concurrent read/write
- ✅ **Tokio & Axum integration**
## Quick Example
```rust
use sockudo_ws::{Config, Message, WebSocketStream};
use futures_util::{SinkExt, StreamExt};
async fn handle(stream: TcpStream) {
let mut ws = WebSocketStream::server(stream, Config::default());
while let Some(msg) = ws.next().await {
match msg.unwrap() {
Message::Text(text) => ws.send(Message::Text(text)).await.unwrap(),
Message::Close(_) => break,
_ => {}
}
}
}
```
Same API works for HTTP/2 and HTTP/3!
## Where It's Used
sockudo-ws will power [Sockudo](https://github.com/RustNSparks/sockudo), a high-performance Pusher-compatible WebSocket server designed for HFT applications.
**Coming soon:** N-API bindings for Node.js
## Try It Out
```toml
[dependencies]
sockudo-ws = { git = "https://github.com/RustNSparks/sockudo-ws" }
# With all features
sockudo-ws = { git = "https://github.com/RustNSparks/sockudo-ws", features = ["full"] }
```
Full docs and examples: https://github.com/RustNSparks/sockudo-ws
---
I'd love to hear your feedback, especially from folks working on real-time systems or high-performance networking! Happy to answer questions about the implementation, benchmarks, or future plans.
**Edit:** Benchmarked on AMD Ryzen 9 7950X, 32GB RAM, Linux 6.18
https://redd.it/1q0fuf4
@r_rust
Hey r/rust! I'm excited to share **sockudo-ws**, an ultra-low latency WebSocket library I've been working on for high-frequency trading and real-time systems.
## The Big Win
We're now **~17% faster** than the next fastest Rust WebSocket library, and we actually **match or beat uWebSockets** (the C++ industry standard) in throughput benchmarks:
| Library | Total Time (100k msgs) |
|---------|------------------------|
| **sockudo-ws** | **10.2ms** |
| fastwebsockets | 12.0ms |
| tokio-tungstenite | 34.8ms |
Against uWebSockets, we're achieving 1.02-1.03x their throughput across various workloads while providing a safe, ergonomic Rust API.
## What Makes It Fast?
- **SIMD acceleration** (AVX2/AVX-512/NEON) for frame masking and UTF-8 validation
- **Zero-copy parsing** - direct buffer access without intermediate allocations
- **Write batching (corking)** - minimizes syscalls via vectored I/O
- **Zero-copy API** via `RawMessage` that avoids String allocation for text messages
## Modern Protocol Support
This is where things get interesting. sockudo-ws supports not just HTTP/1.1, but:
- **HTTP/2 WebSocket** (RFC 8441) - multiplexed streams over a single connection
- **HTTP/3 WebSocket** (RFC 9220) - WebSocket over QUIC with 0-RTT and no head-of-line blocking
- **io_uring** - Linux kernel-level async I/O that can be combined with any protocol
The best part? **All transports use the same API**. Your WebSocket handler code works identically whether you're using HTTP/1.1, HTTP/2, HTTP/3, or io_uring underneath.
## Production Ready
- ✅ **Autobahn compliant** - passes all 517 test suite cases
- ✅ **permessage-deflate** compression
- ✅ **Split streams** for concurrent read/write
- ✅ **Tokio & Axum integration**
## Quick Example
```rust
use sockudo_ws::{Config, Message, WebSocketStream};
use futures_util::{SinkExt, StreamExt};
async fn handle(stream: TcpStream) {
let mut ws = WebSocketStream::server(stream, Config::default());
while let Some(msg) = ws.next().await {
match msg.unwrap() {
Message::Text(text) => ws.send(Message::Text(text)).await.unwrap(),
Message::Close(_) => break,
_ => {}
}
}
}
```
Same API works for HTTP/2 and HTTP/3!
## Where It's Used
sockudo-ws will power [Sockudo](https://github.com/RustNSparks/sockudo), a high-performance Pusher-compatible WebSocket server designed for HFT applications.
**Coming soon:** N-API bindings for Node.js
## Try It Out
```toml
[dependencies]
sockudo-ws = { git = "https://github.com/RustNSparks/sockudo-ws" }
# With all features
sockudo-ws = { git = "https://github.com/RustNSparks/sockudo-ws", features = ["full"] }
```
Full docs and examples: https://github.com/RustNSparks/sockudo-ws
---
I'd love to hear your feedback, especially from folks working on real-time systems or high-performance networking! Happy to answer questions about the implementation, benchmarks, or future plans.
**Edit:** Benchmarked on AMD Ryzen 9 7950X, 32GB RAM, Linux 6.18
https://redd.it/1q0fuf4
@r_rust
GitHub
GitHub - RustNSparks/sockudo: Blazingly fast pusher drop-in replacement written in rust
Blazingly fast pusher drop-in replacement written in rust - RustNSparks/sockudo
Standard Rust-only development environment?
A while ago I saw a video about an experiment where someone tried to use only Rust-based software for their daily work. That got me curious, so I decided to try something similar. I installed Redox OS in a virtual machine and started exploring what a “Rust-only” development environment might realistically look like.
I’m interested in learning which tools people would consider the most common or essential for such an environment—editors, build tools, debuggers, package management, etc.—ideally with links to documentation, manuals, or setup guides.
Do you think this is an interesting experiment worth trying out, or is it more of a “you’d have to be mad to try” kind of idea?
https://redd.it/1q0hd3d
@r_rust
A while ago I saw a video about an experiment where someone tried to use only Rust-based software for their daily work. That got me curious, so I decided to try something similar. I installed Redox OS in a virtual machine and started exploring what a “Rust-only” development environment might realistically look like.
I’m interested in learning which tools people would consider the most common or essential for such an environment—editors, build tools, debuggers, package management, etc.—ideally with links to documentation, manuals, or setup guides.
Do you think this is an interesting experiment worth trying out, or is it more of a “you’d have to be mad to try” kind of idea?
https://redd.it/1q0hd3d
@r_rust
Reddit
From the rust community on Reddit
Explore this post and more from the rust community
[corroded update]: Rust--, now I removed the borrow checker from rust itself
You may have seen the [corroded](https://github.com/buyukakyuz/corroded) lib. I've been thinking, why bother with unsafe code while I can just remove the borrow checker from the compiler entirely?
Now possible at the language level:
* Move then use
* Multiple mutable references
* Mutable borrow then use original
* Use after move in loops
* Conflicting borrows
I've no idea where I'm going with this shit. But I think a lot of interesting stuff will pop up from this that I cannot think of at the moment.
Here is Rust-- for you, repo is [here](https://github.com/buyukakyuz/rustmm).
Happy new year. Enjoy.
https://redd.it/1q0kvn1
@r_rust
You may have seen the [corroded](https://github.com/buyukakyuz/corroded) lib. I've been thinking, why bother with unsafe code while I can just remove the borrow checker from the compiler entirely?
Now possible at the language level:
* Move then use
* Multiple mutable references
* Mutable borrow then use original
* Use after move in loops
* Conflicting borrows
I've no idea where I'm going with this shit. But I think a lot of interesting stuff will pop up from this that I cannot think of at the moment.
Here is Rust-- for you, repo is [here](https://github.com/buyukakyuz/rustmm).
Happy new year. Enjoy.
https://redd.it/1q0kvn1
@r_rust
GitHub
GitHub - buyukakyuz/corroded: Illegal rust
Illegal rust. Contribute to buyukakyuz/corroded development by creating an account on GitHub.
createlang.rs edition 1 is done!
After almost 6 years, it's done.
createlang.rs
The journey https://ehsanmkermani.com/posts/2025-12-31-createlang-rs-complete/
https://redd.it/1q0luy3
@r_rust
After almost 6 years, it's done.
createlang.rs
The journey https://ehsanmkermani.com/posts/2025-12-31-createlang-rs-complete/
https://redd.it/1q0luy3
@r_rust
Introduction ffmpReg, a complete rewrite of ffmpeg in pure Rust
Hi Rustaceans, I’m 21 and I’ve been working on ffmpReg, a complete rewrite of ffmpeg in pure Rust.
The last 5 days I’ve been fully focused on expanding container and codec support. Right now, ffmpreg can convert WAV (pcm_s16le → pcm_s24le → pcm_f32le) and partially read MKV streams, showing container, codec, and timebase info. Full container support is coming soon.
If you find this interesting, giving the project a star would really help keep the momentum going 🥺.
https://preview.redd.it/g01f61ydklag1.png?width=2530&format=png&auto=webp&s=d751a1c9a4af7be9378060da36f4b1a3c7e5321c
https://redd.it/1q0maft
@r_rust
Hi Rustaceans, I’m 21 and I’ve been working on ffmpReg, a complete rewrite of ffmpeg in pure Rust.
The last 5 days I’ve been fully focused on expanding container and codec support. Right now, ffmpreg can convert WAV (pcm_s16le → pcm_s24le → pcm_f32le) and partially read MKV streams, showing container, codec, and timebase info. Full container support is coming soon.
If you find this interesting, giving the project a star would really help keep the momentum going 🥺.
https://preview.redd.it/g01f61ydklag1.png?width=2530&format=png&auto=webp&s=d751a1c9a4af7be9378060da36f4b1a3c7e5321c
https://redd.it/1q0maft
@r_rust
GitHub
GitHub - yazaldefilimone/ffmpreg: In-development universal safe multimedia toolkit.
In-development universal safe multimedia toolkit. Contribute to yazaldefilimone/ffmpreg development by creating an account on GitHub.
Gitoxide in 2025 - a Retrospective
https://github.com/GitoxideLabs/gitoxide/discussions/2323
https://redd.it/1q0m809
@r_rust
https://github.com/GitoxideLabs/gitoxide/discussions/2323
https://redd.it/1q0m809
@r_rust
GitHub
2025 - the Retrospective · GitoxideLabs gitoxide · Discussion #2323
The year in numbers And 365 days later as of 2025-12-31, we are counting 211,983 SLOC, up by 33,827, which is 91% of the year before (➡OTYB) in 14845 commits up by 1,302 and 57%OTYB. There are 65 c...
If rust had a soundtrack which song would be?
I start: Black Label Society - Rust
https://redd.it/1q0plj7
@r_rust
I start: Black Label Society - Rust
https://redd.it/1q0plj7
@r_rust
YouTube
Rust
Provided to YouTube by eOne Music
Rust · Black Label Society
Stronger Than Death
℗ 2018 Wylde Wreckordings, LLC & Entertainment One U.S., LP
Released on: 2018-09-21
Main Artist: Black Label Society
Auto-generated by YouTube.
Rust · Black Label Society
Stronger Than Death
℗ 2018 Wylde Wreckordings, LLC & Entertainment One U.S., LP
Released on: 2018-09-21
Main Artist: Black Label Society
Auto-generated by YouTube.
Is casting sockaddr to sockaddr_ll safe?
So I have a bit of a weird question. I'm using `getifaddrs` right now to iterate over available NICs, and I noticed something odd. For the `AF_PACKET` family the `sa_data` (i believe) is expected to be cast to `sockaddr_ll` (`sockaddr_pkt` is deprecated I think). When looking at the kernel source code it specified that the data is a *minimum* of 14 bytes but (seemingly) can be larger.
[https://elixir.bootlin.com/linux/v6.18.2/source/include/uapi/linux/if\_packet.h#L14](https://elixir.bootlin.com/linux/v6.18.2/source/include/uapi/linux/if_packet.h#L14)
Yet the definition of `sockaddr` in the libc crate doesn't seem to actually match the one in the Linux kernel, and so while I can cast the pointer I get to the `sockaddr` struct to `sockaddr_ll`, does this not cause undefined behavior? It seems to work and I get the right mac address but it "feels" wrong and I want to make sure I'm not invoking UB.
https://redd.it/1q0q9c5
@r_rust
So I have a bit of a weird question. I'm using `getifaddrs` right now to iterate over available NICs, and I noticed something odd. For the `AF_PACKET` family the `sa_data` (i believe) is expected to be cast to `sockaddr_ll` (`sockaddr_pkt` is deprecated I think). When looking at the kernel source code it specified that the data is a *minimum* of 14 bytes but (seemingly) can be larger.
[https://elixir.bootlin.com/linux/v6.18.2/source/include/uapi/linux/if\_packet.h#L14](https://elixir.bootlin.com/linux/v6.18.2/source/include/uapi/linux/if_packet.h#L14)
Yet the definition of `sockaddr` in the libc crate doesn't seem to actually match the one in the Linux kernel, and so while I can cast the pointer I get to the `sockaddr` struct to `sockaddr_ll`, does this not cause undefined behavior? It seems to work and I get the right mac address but it "feels" wrong and I want to make sure I'm not invoking UB.
https://redd.it/1q0q9c5
@r_rust
Java dev learning rust… any projects need help?
Hey guys, experienced developer here just having fun learning Rust.
Currently building random things to get familiar with the ecosystem:
Built a front-end that replaces Lutris using Tauri
Working on a Flappy Bird clone with
macroquad
I think I’m ready to start contributing to something interesting and continue learning. Curious what this community recommends.
https://redd.it/1q0puu7
@r_rust
Hey guys, experienced developer here just having fun learning Rust.
Currently building random things to get familiar with the ecosystem:
Built a front-end that replaces Lutris using Tauri
Working on a Flappy Bird clone with
macroquad
I think I’m ready to start contributing to something interesting and continue learning. Curious what this community recommends.
https://redd.it/1q0puu7
@r_rust
Reddit
From the rust community on Reddit
Explore this post and more from the rust community
Why have C++ and Rust been the fastest-growing major programming languages from 2022 to 2025?
https://herbsutter.com/2025/12/30/software-taketh-away-faster-than-hardware-giveth-why-c-programmers-keep-growing-fast-despite-competition-safety-and-ai/
https://redd.it/1q0tn4o
@r_rust
https://herbsutter.com/2025/12/30/software-taketh-away-faster-than-hardware-giveth-why-c-programmers-keep-growing-fast-despite-competition-safety-and-ai/
https://redd.it/1q0tn4o
@r_rust
Sutter’s Mill
Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI
2025 was another great year for C++. It shows in the numbers Before we dive into the data below, let’s put the most important question up front: Why have C++ and Rust been the fastest-growing major…
zero-mysql, zero-postgres: new DB libraries
https://preview.redd.it/qf1796fi1oag1.png?width=1200&format=png&auto=webp&s=d26438c02c01f8a4bf3421da9052c2de5a553736
[repo: zero-mysql](https://github.com/elbaro/zero-mysql)
repo: zero-postgres
[python mysql benchmark](https://github.com/elbaro/pyro-mysql/blob/main/BENCHMARK.md)
python postgres benchmark
# Handlers
These two libraries use Handler API to enable zero-cost customization without intermediate types. When a network packet containing row data arrives,
https://redd.it/1q0vr7p
@r_rust
https://preview.redd.it/qf1796fi1oag1.png?width=1200&format=png&auto=webp&s=d26438c02c01f8a4bf3421da9052c2de5a553736
[repo: zero-mysql](https://github.com/elbaro/zero-mysql)
repo: zero-postgres
zero-mysql and zero-postgres are developed for pyro-mysql and pyro-postgres (new Python DB libraries). pyro-mysql started with the mysql crate and went through various backend experiments including wtx and diesel, eventually leading to the own library. Since zero-mysql \+ pyro-mysql worked well, the same architecture is extended to zero-postgres \+ pyro-postgres.[python mysql benchmark](https://github.com/elbaro/pyro-mysql/blob/main/BENCHMARK.md)
python postgres benchmark
# Handlers
These two libraries use Handler API to enable zero-cost customization without intermediate types. When a network packet containing row data arrives,
Handler.row(packet: &[u8]) is called. Users can either drop this packet without even looking at it, collect it into a Vec using the provided parse functions, or directly convert it to a PyList or some third-party postgres plugin types. If you SELECT only fixed-length types (integer, float), you can even transmute &[u8] directly into your struct. (A derive macro for this will also be provided)https://redd.it/1q0vr7p
@r_rust
How’s Rust doing for game development?
I was just thinking. Rust would be a great language to write a game engine in.
Pretty much all engines are in C++ at the moment, and memory is a pain to handle in these and they are very complex.
I reckon Rust could give a more modern feel but still have (possibly better, if using certain features) performance.
I’ve heard of Bevy. But I’m just imagining the benefits of stuff like Unity editor like a proper engine but with Rust.
https://redd.it/1q0wtnw
@r_rust
I was just thinking. Rust would be a great language to write a game engine in.
Pretty much all engines are in C++ at the moment, and memory is a pain to handle in these and they are very complex.
I reckon Rust could give a more modern feel but still have (possibly better, if using certain features) performance.
I’ve heard of Bevy. But I’m just imagining the benefits of stuff like Unity editor like a proper engine but with Rust.
https://redd.it/1q0wtnw
@r_rust
Reddit
From the rust community on Reddit
Explore this post and more from the rust community