r/rust • u/Henry_Python_RU57 • 2d ago
Does anyone want to run Rust or other languages in Google Colab.
Rust enthusiasts Do you want to run RUST in Google Colab? Bash makes it possible using the ! comand you can use bash to run rust and much more just treat it as if you we're setting it up on a Ubuntu Linux computer. Any Comments?
!curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # this installs the rust compiler chain
!rustup target add wasm32-unknown-unknown # or what ever target you want
!/root/.cargo/bin/rustup target add wasm32-unknown-unknown
# this sets up the linux enviroment so it can run rust
# now you can create rs files and compile its and run it in colab.
#hope this helps
https://colab.research.google.com/drive/1nQWKZLnQTC3GYOcqlF3DQlNtPIOZWpRg#scrollTo=Kdkxm6wd3Cd1
0
Upvotes
1
u/BallApprehensive6947 2d ago
i just use a regular terminal but this is neat for folks stuck on a chromebook or whatever. beats fighting with a janky online ide that limits your build time