# Introduction to Rust

{% embed url="<https://openguild-labs.github.io/open-rust/syllabus/module/0.1-slides.html#/>" %}

## About Rust programming language

{% embed url="<https://www.rust-lang.org/>" %}
Finding all information about Rust
{% endembed %}

{% embed url="<https://doc.rust-lang.org/book/>" %}
Learn Rust with the Rust Programming Language Book
{% endembed %}

Rust is a systems programming language designed for performance, reliability, and memory safety. It has become popular in the blockchain ecosystem, especially in projects like Polkadot, for its ability to handle high-performance, low-level operations while minimizing risks like memory leaks, race conditions, and other bugs common in lower-level languages. Here’s an overview of Rust and why it’s a powerful choice for blockchain projects:

* **Memory Safety without Garbage Collection**: Rust ensures memory safety without needing a garbage collector, unlike languages like Java or Python. This is critical for blockchain applications, where predictable performance is essential.
* **Concurrency and Parallelism**: Rust’s design makes it easier to write concurrent and parallel programs, which can improve the efficiency and throughput of blockchain nodes and other network components.
* **Performance**: Rust performs similarly to C and C++, making it suitable for use in performance-sensitive environments like blockchain, where nodes often need to process large amounts of data quickly.

## Rust is not the best option for everything.&#x20;

<figure><img src="/files/Ml0wj7LPWFuRl7xeGeFy" alt=""><figcaption></figcaption></figure>

### When not to use Rust?

* Developing user interface (lack of UI components, not flexible as scripting language like Javascript)
* Don’t have a production-ready framework for Web, engine for Game yet.&#x20;
* **Rust is fast, but is it better than React.js or Vue.js?** NO
* **What is the most important part of Game development?** Gaming assets, Game engine (There is no way Rust Bevy Engine is better than Unity or Unreal Engine)

## But with blockchain, it is. Let's learn about the role of Rust in the Polkadot development

Polkadot is built using **Substrate**, a framework developed by Parity Technologies, which is written entirely in Rust. Rust’s features make it an ideal language for Substrate, providing high performance and reliability for Polkadot's complex functionality.

We will learn about Polkadot SDK when we reach the **"Polkadot SDK development"** module. For now, when you visit the Polkadot SDK at <https://github.com/paritytech/polkadot-sdk>, you can obviously see that the SDK is built with 99% in Rust.&#x20;

<figure><img src="/files/SpCyuGKW2EPpHIEKzZlG" alt=""><figcaption><p>Reason why Parity Technologies - company behinds Polkadot SDK - choose Rust as the primary language. </p></figcaption></figure>

## Resources

### OpenGuild Open Workshop Slide | Developing Rust Applications

{% embed url="<https://docs.google.com/presentation/d/1s0jqtgt3DYMfYU7k_gaNOLFR9vMo6rrjJULIak2KdMU/edit?usp=sharing>" %}
Developing Rust Applications
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bootcamp.openguild.wtf/rust-programming-language/basic-rust/introduction-to-rust.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
