Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't really understand the point for writing an "OS in rust and provide rich services for applications to use".

You can use any serialisation method you want (C structs, Protobuf, JSON, ...).

An ABI is for passing data in the programming language and trusting it blindly, e.g. what functions use when calling each other.

Any sane OS still has to validate the data that crosses its boundaries. For example, if you make a Linux system call, it doesn't blindly use a pointer you pass it, but instead actually checks if the pointer belongs to the calling process's address space.

It seems pointless to pick Rust's internal function-calling data serialisation for the OS boundary; that wouldn't make it easier for any userspace programs running in that OS than explicitly defining a serialisation format.

Why would an OS want to limit itself to Rust's internal representation, or why would Rust want to freeze its internal representation, making improvements impossible on both sides? This seems to bring only drawbacks.

The only benefit I can see so far for a stable ABI is dynamic linking (and its use in "plugins" for programs where the code is equally trusted, e.g. writing some dlopen()able `.so` files in Rust, as plugins for Rust-only programs), where you can really "blindly call the symbol". But even there it's a bit questionable, as any mistake or mismatch in ABI can result in immediately memory corruption, which is something that Rust users rather dislike.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: