Rust is a Static
and Strong
programing language.
- Static - We know all of the data types at compile time
- Dynamic - We only know the data types at run time
- Strong - Enforces rules on data type assignments
- Weak - Has Few or no enforcement on data type assignments
- Compiled, used to be faster
- Interpreted, slower since bit code in generated on each execution. More portable since they are "compiled" at run time
- Stack - pila, last in last out, when stack overflow happens, to many data -> we use the heap
- Heap - has a pointer pointing to the data in memory
- Most of the variables cannot change their value, you can handle this creating
mutable
variables, but they are not the default one. Ownership and Burrowing
, Core rust memory managementAssociated methods
, method associated to a data structureCrates
, modulesMacros
, (!) primitive functions
Toolchain components:
- Rust Compilet
- Cargo (package manager)
Rustup, a toolchain management utility
> rustc
- Integers
- (u)unsiged 0 - 255
- (i)signed -128 127
- isize, usize - related to the CPU architecture
- floating points - singed
- True / False
- A, B, C (ASCII)
Rush uses 4 Bytes, 4.294.967.296, characters in Unicode-32 table, basically support everything
- Multiples values of a single data types
- Multiples values of different data types
Array and Tuples has a FIXED size
We have two alternatives:
- mutable
- u8 data vector
- stored on the heap
- Immutable
- u8 data vector
- stored on the heap/stack or compiled code