Learning Rust in Termux
I’ve been looking to learn rust due to its memory safety features compared to C. Also Rust is used in many embedded platforms even though there isn’t much commercial support for rust in embedded systems.1
Anyway, I decided to start it today.
There is a rust package in the termux-main repo. Installing it was as simple as running pkg install rust
The installation can be checked by running the command rustc –version On 11-Feb-2024, it returned rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
I then fired up Duckduckgo browser and went to the official Rust site to check out the Rust Getting started guide It was very easy to follow.
Rust uses a package manager called cargo. In rust packages are called crates. There is a file called Cargo.toml which cantains the package metadata and dependencies.
Anyway as per the getting started guide, I ran cargo new hello-rust which generated a hello world project for me.
After that cd into the newly created directory cd hello-rust
Then i ran cargo run Which compiled the generated project and ran it.
I’ll have to further learn the rust language syntax and semantics and how to develop embedded projects using Rust.
I hope to make another post soon. Till then, Tschüss.