DEV Community

El Bruno for Microsoft Azure

Posted on β€’ Originally published at elbruno.com on

1

#Rust – Install Rust and Hello World 🌐 in #RaspberryPi

Hi !

Quick post today on how to install rust in a Raspberry Pi, and later create a hello world test app.

Install Rust

I’m starting this with the latest updates for Raspberry Pi OS installed.

current raspberry pi os installed

The command to install rust is this one:


curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Enter fullscreen mode Exit fullscreen mode

Check the Rust Lang documentation for more details.

Let’s choose the default installation, this may take a couple of minutes.

And now, we can check the rust and cargo versions with the following commands


rustc --version
cargo --version

Enter fullscreen mode Exit fullscreen mode

checking rust and cargo versions with command line

Hello World project

Now let’s use cargo to create a new project. I’ll name it β€œDemoBlogPost”. In the following image, we can check the default contents of the project

  • cargo.toml
  • src/main.rs

createing a new project with cargo and check the generated files

Time to edit the main.rs file. I’m not a VIM user, so it’s nano time.

editing the main rs file with nano

And now, time to run the project !

Super fun and literally a great way to use a device like a raspberry pi to learn Rust !

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.


Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay