---
title: "Hello World in Rust"
canonical_url: https://developer.repebble.com/pebbleos/docs/samples/rust/hello_world/
last_updated: 2026-11-18
sdk_version: 4.44
---
# Hello World in Rust

Source: https://developer.repebble.com/pebbleos/docs/samples/rust/hello_world/

The smallest [Rust application](https://developer.repebble.com/pebbleos/docs/development/build_system/rust.md): it prints a message from `main()` with `println!`.

Run:

`pbl samples samples/rust/hello_world`

Boards:

every board

## Sources

CMakeLists.txt

```
cmake\_minimum\_required(VERSION 3.20)find\_package(PebbleOS REQUIRED HINTS $ENV{PEBBLEOS\_BASE})project(hello\_world)pbl\_rust\_app()
```

Cargo.toml

```
[package]name = "hello\_world"version = "0.1.0"edition = "2024"license = "Apache-2.0"publish = false[lib]crate-type = ["staticlib"][dependencies]pebbleos = { path = "../../../rust/pebbleos" }
```

src/lib.rs

```
#![no\_std]use pebbleos::println;#[pebbleos::main]fn main() {println!("Hello World! {}", pebbleos::kconfig::BOARD);}
```

## Output

```
Hello World! \w+
```

Generated from PebbleOS [7753e801d](https://github.com/coredevices/pebbleos/commit/7753e801d93d20f2d37534ce2fa69d9952015237). This page is maintained in the pebbleos repository: [docs/samples/rust/hello\_world.md](https://github.com/coredevices/pebbleos/blob/7753e801d93d20f2d37534ce2fa69d9952015237/docs/samples/rust/hello_world.md).
