Using self-compiling & self-executing rust source code to replace quick-and-dirty shell scripts in under 10 lines

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • runner

    Tool for running Rust snippets (by stevedonovan)

  • I have used Runner for this in the past, but my problem was that I could not get rust-analyzer to work with it, since the scripts are not a "proper" cargo package.

  • rust-script

    Run Rust files and expressions as scripts without any setup or compilation step.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • rust-analyzer

    Discontinued A Rust compiler front-end for IDEs [Moved to: https://github.com/rust-lang/rust-analyzer] (by rust-analyzer)

  • It is supported by RA, but I haven’t gotten around to editing the IDE plugin (vim lsp in my case) to handle the case automatically. You can see how here: https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc#non-cargo-based-projects and that it is a hassle to do on a one-off basis without automation from the IDE.

  • scriptisto

    A language-agnostic "shebang interpreter" that enables you to write scripts in compiled languages.

  • Scriptisto is another alternative which I personally use.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts