Announcing Rust Support in CodeSandbox
Hello, Rust community! You can now spin up a Rust development environment in CodeSandbox.
Rustaceans rejoice! Today, we are launching official Rust support for CodeSandbox. This update allows you to spin up a Rust development environment within 2 seconds, with IntelliSense support and the ability to open the environment in iOS or VS Code.
We are building CodeSandbox—a cloud development platform that makes it incredibly easy to spin up a cloud environment and share it with others.
If you have used CodeSandbox before, chances are that you are building cool web apps using JavaScript. In 2022 alone, we saw our community create more than 14 million sandboxes. That’s mindblowing!
But web development is changing faster than ever, with new languages like Rust providing excellent alternatives to JavaScript.
We absolutely love Rust and all the amazing things it brings to the developer community. So, today we launched official Rust support for CodeSandbox and created a template you can use to start coding 🎉
A thriving community
Rust is getting more popular by the day. In just 2 years, the community nearly tripled from 600k to 2.2 million developers and it’s been the most loved language for 7 years in a row.
And that’s understandable! Rust provides a great balance between language features, speed and security. I'm continuously impressed by it. It’s fast—super fast!
In our own work at CodeSandbox, a big part of our architecture is written in Rust because of the great control we get over things like error handling. We have also used Rust to rewrite some of our code and see similar stunning performance improvements. I won’t spoil it for you, but rest assured that many exciting announcements are still coming!
And Rust is still growing. More and more developers are looking into Rust and want to get started with it. That’s why we decided to add official support for Rust as our first new language on CodeSandbox.
Thanks to the recent Docker support the team has built, implementation became quite straightforward. Of course, we still needed to add LSP support and a few tweaks here and there to ensure a pleasant developer experience—but soon enough, I was ecstatic to be coding in a Rust sandbox!
A powerful Rust coding experience
To get started, you can fork the Rust template from the dashboard, or from this link directly (there’s a “Fork” button in the header). When you do this, we will clone the VM of the template to give you a running Rust environment within 2 seconds.
From there, you can do anything that you would want to do locally. You can open a terminal and add dependencies, write Rust code or even open this project in our iOS IDE or in VS Code.
The web IDE runs rust-analyzer
for getting autocompletions, type information and language code actions like “turn if into match statement”.
Every sandbox also has a public URL that you can share with others. This way you can easily share your running Rust app with others. If you want to collaborate with someone, you can also invite them through the share button.
Lastly, if the sandbox is becoming bigger, you can export it to GitHub. We also have tight integration with GitHub, so you can continue using CodeSandbox while committing to GitHub.
See this in action below in our Rust & Serde template:
But why CodeSandbox?
So, why should you consider building your Rust projects on CodeSandbox rather than doing it locally?
CodeSandbox gives you an always-ready, powerful environment you can open with a URL to code.
This is really useful if you simply want to quickly test something or play around with code—you can spin up a sandbox in seconds and test without having to install or configure anything.
But CodeSandbox is built to go way beyond that. You can do your whole development inside CodeSandbox using Repositories, which are connected to git.
So you can work on a branch of your project, commit changes to git, and whenever someone else is reviewing your code, they simply open that PR as a CodeSandbox URL and get the whole environment running alongside a preview, tests, Storybook, and any other tools you configure. It really speeds up the review process!
Plus, you can enjoy all these features while using the editor of your choice—our own web editor, our iOS IDE, or VS Code, using our extension.
Making coding more accessible to everyone
We are beyond excited to welcome the Rust community to CodeSandbox!
After years of painstakingly finding ways to provide a robust and fast coding experience in JavaScript, we want to empower everyone to code in the cloud, no matter what language they’re using to write code.
And who knows? One year from now, we might look back at this post and marvel at how this sparked an even more thriving community.
Don’t forget to jump right into our Rust template to start coding!
Note that we are still ironing out a few kinks (for instance, go to definition for source files or dependency files), so you can expect some fixes and incremental updates in the coming days. Feel free to join our community platform to let us know how we can make your experience even better.