News for hackers. Stuff that matters.
Re:Low-Level Optimization with Zig by LAC-Tech on Saturday June 07, 2025 @11:27PM (#44214351)
Kernels are big pieces of software. Rust is used for device drivers mainly, right? So in that case you write an idiomatic rust lib and wrap it in a C interface and load it in.

Actually interfacing with idiomatic C APIs provided by an OS is something else entirely. You can see this is when you compare the Rust ecosystem to Zig; ie Zig has a fantastic io-uring library in the std lib, where as rust has a few scattered crates none of which come close the Zig's ease of use and integration.

One thing I'd like to see is an OS built with rust that could provide its own rusty interface to kernel stuff.

Re:Low-Level Optimization with Zig by ArtixFox on Sunday June 08, 2025 @07:39AM (#44216334)
Hello can you point me to more information about zig's and rust's io-uring implementations
Re:Low-Level Optimization with Zig by LAC-Tech on Sunday June 08, 2025 @04:46PM (#44219383)
Hey Artix!

Zig's is in the standard library. From the commits it was started by Joran from Tigerbeetle, and now maintained by mlugg who is a very talented zig programmer.

https://ziglang.org/documentation/master/std/#std.os.linux.I...

The popular Rust one is tokio's io-uring crate which 1) relies on libc; the zig one just uses their own stdlib which wraps syscalls 2) Requires all sorts of glue between safe and unsafe rust.

github.com/tokio-rs/io-uring

Re:Low-Level Optimization with Zig by ArtixFox on Sunday June 08, 2025 @10:34PM (#44221002)
thank you!
Re:Low-Level Optimization with Zig by WD-42 on Sunday June 08, 2025 @10:20AM (#44217182)
The OS is called Redox.
Re:Low-Level Optimization with Zig by LAC-Tech on Sunday June 08, 2025 @04:47PM (#44219391)
It actually provides rust APIs to dev systems software against that run on it?

I know it's written in rust, but I am talking more specifically than that.