Rust Explorer: A playground that has over 10,000 most downloaded crates

TLDR: Rust Explorer

A few months ago, I began working on a Rust project that uses a few large dependencies. The compilation took a few minutes on my slow laptop. Every time I make small changes, I had to wait for a few minutes.

My workaround at the t…


This content originally appeared on DEV Community and was authored by aguspdana

TLDR: Rust Explorer

A few months ago, I began working on a Rust project that uses a few large dependencies. The compilation took a few minutes on my slow laptop. Every time I make small changes, I had to wait for a few minutes.

My workaround at the time was by creating smaller repl packages. Once they worked I'd copy/paste them into the main package. This is clearly not ideal. Navigating between many packages and copy/paste-ing codes was cumbersome, especially when working on NeoVim.

So I decided to put aside my main project for awhile to build Rust Explorer.

What you can do with it?

  • Use the top 10,000 most downloaded crates in the last 90 days.
  • Set [profile.dev] for benchmarking.
  • Access the internet.
  • Save files and read them on subsequent runs.

Other notable features:

  • Streaming output, useful for working with async code.
  • ASCII color support to spot error easily.
  • Save bins and group them into collections.
  • Revisit execution history.

How it works?

This project is highly inspired by the official playground. In early iterations, I tried to compile the 10,000 crates all at once. But they failed on the first few crates because of issues like version conflict, platform not supported, and system library not found.

I then tried to compile them one by one with all features enabled and skipped crates that failed to compile. Many did fail. The compilation output took so much space that I only managed to compile only 1000 crates.

I wasn't happy with the container startup time which (again, on my slow laptop) could take 5s.

I tried to compile to wasm. The startup time was much better, under 1s. But many crates couldn't be compiled to wasm, e.g. rand. Wasm was very limited, so I abandoned it.

After some experiments I arrived at the current version. Each user has a compiler and executor running continuously. This way we don't need to recompile the same dependencies. Plus, we avoid running a new container on every run.

With collections, we can use Rust Explorer like a jupyter notebook. For example one bin is used for downloading and writing csv files. And other bins are used to query the data.

Here are some examples:

I hope this project could be useful for some Rust devs too.


This content originally appeared on DEV Community and was authored by aguspdana


Print Share Comment Cite Upload Translate Updates
APA

aguspdana | Sciencx (2022-06-15T13:34:47+00:00) Rust Explorer: A playground that has over 10,000 most downloaded crates. Retrieved from https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/

MLA
" » Rust Explorer: A playground that has over 10,000 most downloaded crates." aguspdana | Sciencx - Wednesday June 15, 2022, https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/
HARVARD
aguspdana | Sciencx Wednesday June 15, 2022 » Rust Explorer: A playground that has over 10,000 most downloaded crates., viewed ,<https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/>
VANCOUVER
aguspdana | Sciencx - » Rust Explorer: A playground that has over 10,000 most downloaded crates. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/
CHICAGO
" » Rust Explorer: A playground that has over 10,000 most downloaded crates." aguspdana | Sciencx - Accessed . https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/
IEEE
" » Rust Explorer: A playground that has over 10,000 most downloaded crates." aguspdana | Sciencx [Online]. Available: https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/. [Accessed: ]
rf:citation
» Rust Explorer: A playground that has over 10,000 most downloaded crates | aguspdana | Sciencx | https://www.scien.cx/2022/06/15/rust-explorer-a-playground-that-has-over-10000-most-downloaded-crates/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.