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

Map of mustang and rustix #123

Closed
sunfishcode opened this issue Jun 24, 2022 · 1 comment
Closed

Map of mustang and rustix #123

sunfishcode opened this issue Jun 24, 2022 · 1 comment

Comments

@sunfishcode
Copy link
Owner

I recently learned about Mermaid diagrams, and I recently had a discussion with someone who gave me the idea to make a diagram to show how some of the parts in and around Mustang relate to each other. Here's what I came up with:

graph TD;
    ripgrep["ripgrep (and other programs)"]-- optionally -->std-unmodified;
    ripgrep-- optionally -->std-ported;
    std-unmodified["std (unmodified)"]-->c-scape;
    std-ported-->origin;
    std-ported["std (ported)"]-->rustix;
    c-scape-->rustix;
    c-scape-->origin;
    origin-. optionally .->platform-libc;
    origin-->rustix;
    origin-. optionally .->linux-syscalls;
    rustix-- optionally -->platform-libc;
    rustix-- optionally -->linux-syscalls;

Mustang is the experimental project which currently includes c-scape and origin and some support tools to help compile programs to use them, allowing people to try them out on real programs such as ripgrep. This doesn't require any changes to std's code.

A sibling project is the port of std to origin and rustix. The port is not complete, though it is mostly usable since rustix calls can coexist with the existing libc calls. Compared to the Mustang approach, this approach results in simpler and more efficient code, since it avoids Rust calling through the C ABI, translating back into idiomatic Rust, and then translating into the C-like system calls or platform libc ABI. It stays in Rust until the syscalls. It also factors out a lot of low-level unsafe blocks and error handling from the higher-level logic of std.

Some people have asked about what an official Rust target using these components might look like. There are a variety of ways this could be done, though there's more work and reorganization needed. At this time, work toward this goal is on hold as there hasn't been sufficient community interest. If anyone has thoughts about what they'd like to see here, please reach out!

Both Mustang and the port of std to rustix serve as interesting testcases for rustix, so I hope to continue maintaining them for that purpose.

Rustix itself is a relatively mature project, which is used in production, and which is part of several much larger stories, including I/O safety and cap-std, which themselves are part of larger stories, so even though some of the goals are on hold, rustix will continue to have other goals, and I plan to continue to actively maintain rustix.

@tshepang
Copy link
Contributor

would be kool to submit the rustix port as a draft PR so that perf can be run on it

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