Code Monkey home page Code Monkey logo

rust-playground's Introduction

Rust Playground

This is the home of the Rust Playground, also hosted by Integer 32.

What's it do?

The playground allows you to experiment with Rust before you install it locally, or in any other case where you might not have the compiler available.

It has a number of features, including:

  1. A nice, unobtrusive editor with syntax highlighting.
  2. The ability to compile in debug or release mode against the current stable, beta, or nightly version of Rust.
  3. The top 100 popular crates (ranked by all-time downloads), crates that are part of the Rust Cookbook and all of their dependencies are available for use!
  4. The ability to quickly load and save your code to a GitHub Gist and share it with your friends.
  5. rustfmt and Clippy can be run against the source code.
  6. The ability to see the LLVM IR, assembly, or Rust MIR for the source code.

Architecture

A React frontend communicates with an Axum backend. Docker containers are used to provide the various compilers and tools as well as to help isolate them.

We hope that this frontend and backend stack is comfortable to potential contributors! If you are interested in contributing, please feel free to ask a question and we might even be able to point out some useful resources.

Resource Limits

Network

There is no network connection between the compiler container and the outside world.

Memory

The amount of memory the compiler and resulting executable use is limited by the container.

Execution Time

The total compilation and execution time is limited by the container.

Disk

This sandbox does not provide any disk space limits. It is suggested to run the server such that the temp directory is a space-limited. One bad actor may fill up this shared space, but it should be cleaned when that request ends.

Security Hall of Fame

A large set of thanks go to those individuals who have helped by reporting security holes or other attack vectors against the Playground. Each report helps us make the Playground better!

  • Preliminary sandbox testing (PID limit) by Stefan O'Rear.

If you'd like to perform tests that you think might disrupt service of the Playground, get in touch and we can create an isolated clone to perform tests on! Once fixed, you can choose to be credited here.

Development

Build the UI

cd ui/frontend
yarn
yarn run watch # Will rebuild and watch for changes

If you don't need the backend running because you are only making basic HTML/CSS/JS changes, directly open in your browser the built ui/frontend/build/index.html.

Build and run the server

cd ui
cargo run

There are some optional configuration parameters described in the ui README which you may set in a .env file. The server will run with no configuration, but in order to load and save gists a GitHub token must be configured.

Build or download the containers

cd compiler
./build.sh # If you want to test changes to the containers
./fetch.sh # If you just want the current playground

Deployment

License

Licensed under either of

rust-playground's People

Contributors

shepmaster avatar dtolnay avatar lqd avatar ralfjung avatar wfchandler avatar cybai avatar weihanglo avatar hkalbasi avatar carols10cents avatar snnsnn avatar dependabot[bot] avatar clubby789 avatar byron avatar oli-obk avatar jyn514 avatar joekyo avatar ehuss avatar camelid avatar schuelermine avatar adwinwhite avatar notriddle avatar budziq avatar riateche avatar rw avatar dns2utf8 avatar chandlore avatar nemo157 avatar chazkiker2 avatar dawnofmidnight avatar didil avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.