top | item 38531690

Youki: A container runtime written in Rust

24 points| wspeirs | 2 years ago |github.com

4 comments

order

sigmonsays|2 years ago

I wanna know why...

One main reason for using rust is safety and there is a lot of unsafe rust code in the repo.

milliams|2 years ago

I'd argues it's less about not having any `unsafe` code, but rather about being able to easily identify where that unsafe code lives. In a C or C++ codebase, you'll also have "unsafe" code but there's no easy way of identifying and locating it.

This aids both auditing and also targeting your work to reduce it if desired.

steveklabnik|2 years ago

> there is a lot of unsafe rust code in the repo.

loc says there's 28,277 lines of Rust code. I count 48 instances of using unsafe, and two instances of defining an unsafe function. The vast majority seems to be stuff like calling c apis like fork, setrlimit, and such. That doesn't strike me as "a lot" personally.

utam0k|2 years ago

I am the author of this. Safety is one. Recently, another strength is Wasm support ;) youki has been an important key person for Wasm support in K8s.