Compiler-explorer: Crates for Rust

Created on 7 Jan 2018  路  3Comments  路  Source: compiler-explorer/compiler-explorer

Considering other languages have some libraries, this probably makes sense for Rust too, especially since Rust's std is fairly bare bones. Everyone uses a lot of crates even in fairly simple snippets, because of that. And that's totally fine, as it's absolutely easy with cargo to use external crates, so std doesn't even need to provide a lot of things. That however means that without any crates, you are fairly restricted, so both Godbolt and the original Rust playground are / were fairly suboptimal for Rust. The Rust Playground then added the Top 100 crates and now you can do a lot more with it. So I think it makes sense to do something similar for Godbolt. Maybe the implementation could even mostly be taken from the Playground source.

enhancement help wanted lang-rust

Most helpful comment

The Rust Playground has a little Rust tool (naturally) to fetch the list of top crates it uses:
https://github.com/integer32llc/rust-playground/tree/master/top-crates

The biggest hurdle here would be that you'd either have to run cargo instead of just rustc to allow it to figure out the dependency tree (the Rust Playground does this), or you'd have to pre-compile every available crate with every available version of rustc into known locations and manually pass the proper set of crates to rustc.

All 3 comments

The Rust Playground has a little Rust tool (naturally) to fetch the list of top crates it uses:
https://github.com/integer32llc/rust-playground/tree/master/top-crates

The biggest hurdle here would be that you'd either have to run cargo instead of just rustc to allow it to figure out the dependency tree (the Rust Playground does this), or you'd have to pre-compile every available crate with every available version of rustc into known locations and manually pass the proper set of crates to rustc.

Main discussion here for some reason #754

That links back to this issue. I believe you meant to say the main discussion is at #1925

Was this page helpful?
0 / 5 - 0 ratings