News for hackers. Stuff that matters.
Re:Porting Rust's Std to Rustix by algesten on Tuesday January 04, 2022 @09:54AM (#29795382)
If this was merged into Rust, I assume it means the use of `unsafe` in std would be "pushed down" one level into Rustix instead.

Wonder if that means it would be easier to verify the correctness of `unsafe` use inside Rust itself?

Re:Porting Rust's Std to Rustix by ansible on Tuesday January 04, 2022 @10:08AM (#29795543)
The goal is to get this is merged into Rust's std library, they wouldn't write std on top of Rustix.

> Wonder if that means it would be easier to verify the correctness of `unsafe` use inside Rust itself?

If you mean usage of unsafe inside std (which the Rust compiler does depend upon), that is one of the explicit goals of Rustix. The usage of unsafe will be much more narrow overall, mostly surrounding the system calls themselves.

Re:Porting Rust's Std to Rustix by Arnavion on Tuesday January 04, 2022 @12:42PM (#29797499)
The port of libstd linked in the article still uses rustix as a separate crate.

In any case, I hope it remains separate. Third-party no_std code would benefit from it.

Re:Porting Rust's Std to Rustix by ansible on Tuesday January 04, 2022 @02:31PM (#29799002)
I am under the impression that no-std code is primarily the concern of embedded systems that might not have much of an OS [1] at all, nevermind a suite of system calls to Linux.

[1] Like a typical RTOS, that may provide some basic communication primitives, thread creation, and a hardware abstraction layer (HAL).

Re:Porting Rust's Std to Rustix by roblabla on Tuesday January 04, 2022 @04:10PM (#29800572)
That is nor necessarily the case. Embedded is a big user, but there are other reasons to use no_std, such as explicitly wanting to avoid heap allocations, or wanting greater control over the native APIs being called.
Re:Porting Rust's Std to Rustix by sitkack on Wednesday January 05, 2022 @11:55AM (#29811450)
Also Wasm support (can be viewed as a kind of embedded) and better portability. Anything that helps one separate the platform and more precisely define the platform boundary the better.

Libc is necessary, but not good.

Re:Porting Rust's Std to Rustix by algesten on Tuesday January 04, 2022 @10:12AM (#29795580)
Yeah, that's what I mean. Sounds good!