Rust Explorer playground now supports CLI, Vim, rustfmt, clippy, and macro-expand

73 points aguspdana

Now you can use the playground without login.

https://www.rustexplorer.com/

CLI

You can build a command line app on the playground without retyping the commands every time you want to try it. Here's how it works:

  • Command lines are written inside a block comment /* */.
  • Each command starts with $.
  • You can run the compiled code with ./playground or play.
  • If a command line block is detected, the compiled code will not be executed automatically.
  • If the first command is empty, cargo build will be skipped.
  • Exporting environment variable doesn't work.

An example using clap: https://www.rustexplorer.com/b/b2pyw2

Vim

The editor now uses CodeMirror and supports Vim mode. As a bonus, the syntax highlighting is much better.

Higher memory limit

Before this update, some crates like polars and actix-web can't be compiled because the compiler hits the memory limit. Now you can use those crates.

An example using polars: https://www.rustexplorer.com/b/7w4tkc

What else?

  • rustfmt (red)
  • clippy (yellow)
  • macro-expand (green)
  • The user page has been redesigned.

Please let me know "What features would make the playground complete?\