Live data from Hacker News

Memory safety for the world’s largest software project

memorysafety.org

1–10 of 62 posts

Re: Memory safety for the world’s largest software project

#2
So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

Re: Memory safety for the world’s largest software project

#3
post #2

So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

Theoretically yes, rust binaries can have C-apis and other code can call them just fine.

Re: Memory safety for the world’s largest software project

#4
post #2

So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

Yep! At our company, for example, we have built a plugin for PAM in Rust which exposes all the necessary functions with a C interface.

Re: Memory safety for the world’s largest software project

#5
post #3
post #2

So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

Theoretically yes, rust binaries can have C-apis and other code can call them just fine.

With the caveat that, naturally, these APIs can only expose concepts that C can understand, so you're a bit limited. No generics, for example.

Re: Memory safety for the world’s largest software project

#6
post #2

So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

The RUST FFI is just the C function interface. You can completely fool the C code that you are also C code.

Re: Memory safety for the world’s largest software project

#7
post #2

So, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?

Not only is it possible, being able to do so well is a design constraint on the language.

Re: Memory safety for the world’s largest software project

#10
post #5
post #3

Earlier quoted context omitted.

Theoretically yes, rust binaries can have C-apis and other code can call them just fine.

With the caveat that, naturally, these APIs can only expose concepts that C can understand, so you're a bit limited. No generics, for example.

Also, no memory safety...
Post reply on HN