sunfishcode / mustang

Rust programs written entirely in Rust
Other
827 stars 24 forks source link

News: origin goes standalone, origin-studio says `println!("Hello, world!")` #222

Closed sunfishcode closed 1 year ago

sunfishcode commented 1 year ago

Origin now lives in its own repo

Origin is a crate that provides the basic infrastructure needed to write small and simple programs entirely in Rust.

Origin was previously in the mustang repo, and it has now moved to a new repo, where it can better focus on being usable on its own. And it's been refactored to make it easier to use:

New sibling project: origin-studio

origin-studio is a new library on top of origin that contains a very reduced alternate std implementation that supports println! and a std::thread-like API and a few other things, and also re-exports core and optionally alloc, so it makes it easy to write simple examples using origin.

Mustang continues to be a layer on top of origin

Mustang works by providing its own C-ABI-compatible libc implementation, using origin and rustix inside, which allows it to slot in underneath a lot of existing code, including standard library code.

Mustang supports many more features than origin-studio. At this time, it's complete enough to run ripgrep, coreutils, async-std, tokio, bat, cargo-watch, and more. Files, networking, threads, linking to C libraries, and lots of other things work.

The main downsides of mustang compared to origin-studio are that it uses a custom target which makes it awkward to use, there's some overhead incurred in providing C-ABI-compatible libc interfaces, compared to just calling the underlying Rust APIs directly, and it doesn't support LTO.