Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide writeable console implementation in the Rust library #22

Open
mcandre opened this issue Dec 26, 2018 · 1 comment
Open

Provide writeable console implementation in the Rust library #22

mcandre opened this issue Dec 26, 2018 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Dec 26, 2018

The Rust tutorial for developing CloudABI programs requires the developer to write a substantial amount of unsafe code by hand in order to be able to use cloudabi::fd's with typical Rust writing functions and macros. Could we include this console write implementation in the crate by default, so that developers can use cloudabi in a more safe and convenient manner?

https://cloudabi.org/write/rust/

@EdSchouten
Copy link
Member

Agreed!

When doing so, we should also keep in mind that the numbers stored in Argdata don't necessarily need to map to file descriptor numbers directly. They are merely logical indices to handles that are not part of the data.

Getting this right is essential to getting stuff like ARPC working. The message sent across the line can't make any assumptions about what the file descriptor numbers look like on the sending/receiving side, as they are dynamically allocated. It's up to the RPC framework to map the logical numbers back to file descriptor numbers.

(I have to confess I haven't been able to spend a lot of time with Rust lately. Anyone willing to take a stab at this? Would love to review, though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants