Giter Site home page Giter Site logo

bhupendra-chouhan / rust-basics Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 645 KB

Learn import Rust fundamentals that you need in order to get started with writing Soroban smart-contracts for Stellar Blockchain

Rust 88.42% Makefile 11.58%
rust rust-lang soroban stellar

rust-basics's Introduction

What is Rust?

  • Statically typed language
  • Systems programming language (lies betweeen LLP and HLP)
  • No Garbage Collection -> Memory Management is Deterministic -> Predictible performance optimization and output

Rust documentation resources:

Install Rust using command:

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

Run Rust program using command:

<!-- To compile rust program -->
rustc filename.rs

<!-- To execute the executable file -->
./filename.exe

Cargo package manager:

  • Used to build Rust projects
  • Help you easily use and mange Rust basd dependency/packages

Create a Project with Cargo:

cargo new project_name
cd project_name

Build and run a Cargo project:

cargo run

The Rust Programming Language:

Data Types

Two types of data types:

  • Four Scalar Types: Store Single Values

    • Signed & Unsigned Integers
    • Floating-Point Numbers
    • Booleans
    • Characters
  • Compound Types: Store Multiple Values

    • Arrays
    • Vectors
    • Strings
    • Tuples
    • Maps

Writing Soroban Smartcontracts:

  • #![no_std] : This Used to prevent rust from loading the standard library.

rust-basics's People

Contributors

bhupendra-chouhan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.