Rust programming language

April 23, 2021

Lang: cs en de es

The Rust programming language is a modern, fast, high-level and safe programming language. What are its advantages and how to get started?

The Rust programming language is a young programming language with interesting features, that give it the potential for success. And for some purposes, it is downright suitable, so you can use it to efficiently solve the task at hand.
Moreover, it is compatible with the existing C library ecosystem, so it can be used well alongside existing solutions.

Rust language features:

  • both high-level and low-level
  • fast as C
  • can be used to call common Linux libraries written in C
  • enables parallel programming
  • supports threading
  • full UTF support
  • safe
  • translation to native code
  • anonymous features
  • better error listing during translation
  • has Cargo
  • package system

Details on the history of Rust

As the number of users and the community around the Rust language grows, so does the ecosystem, so that by 2021, there may be jobs available and with this technology build a career.

Packaging System

Since the number of libraries is already growing, it's a good idea to address their management somehow, and that's what the package system is for. For the Rust programming language ecosystem, the packaging system is cargo. You can find a list of searchable Rust library packages on the https://crates.io/

How to start programming in Rust

If you want to start programming in Rust, you'll need some tools - primarily a compiler. I've prepared a docker image here, which is available on github. If you use this image, you can compile programs written in Rust. There is a compiler - the rustc command. And also cargo, which is a package management tool that you can use to deal with library installation efficiently. The cargo program, allows you to create projects in the Rust language, compile your project or install extensions to the language Rust.

Make a local clon git repository with docker configuration that allows you to prepare a tool container for Rust.

git clone https://github.com/josefjebavy/rust-example-docker 

Build docker image:

docker build ./ -t rust

Starting the container:

docker run -it -v ${PWD}:/srv rust /bin/bash

Sample hello word code:

fn main() {
    println!("Hello, world!");
}

Create a project using cargo, compile and run it:

 cargo new hello
 cd hello
 cargo run
./target/debug/hello

Compilation started directly by calling the compiler and running

rustc src/main.rs
./main

Video tutorial Rust

Here is a video tutorial on how to prepare your development environment for programming in Rust and a basic demonstration of creating a program:

The Future of the Rust Programming Language

Rust, thanks to its features, has, in my opinion, a great chance to become more widely used over time. Moreover, it has a chance to replace C. So, combining these two features with the fact that it has already caught on in important projects, I think it's going to be one of the most widely used programming languages in the future.

Links

Rust installation documentation
How to get started with Rust
Docker hub Rust

Články na podobné téma

Python program to control Docker using the API
How to use MailCatcher to test emails
Python OpenAI API
Creating a WebSocket web application and setting up a proxy
Project management: agile software development
How to run old PHP applications
What a good programmer should know
NodeJS: development, server configuration
Nette security bug CVE-2020-15227
REST API: platform API
Custom web and mail hosting with ISP Config software
Programming in SQL: PostgreSQL, MySQL/MariaDB
HTTPS: secure web
NoSQL database Mongo DB
Connecting to Microsoft SQL Server from Linux
What is the job description of a programmer
Python application localization
Which mail and web hosting to choose
Digispark - Program Atmel ATtiny microcontroller with Arduino IDE
Development for ARM processors with Arduino IDE
How to program the ESP8266 WiFi processor
Open smartphone with Linux - Openmoko Neo FreeRunner

Newsletter

If you are interested in receiving occasional news by email.
You can register by filling in your email news subscription.


+