Trying out rust sample programs.
- strongly typed, can't assign from one type to another
- statically typed, checks type at compile-time
- variables are immutable by default, have to explicitly use
mutkeyword to make them mutable - all memory accesses are checked
- strict ownership management
- array-bounds are checked
- code organized as
- functions : similar to c++ functions
- modules : similar to namespaces/files in c++, math can be a module
- crates : similar to an executable/library/plugin/extension, json would be a crate
Cargo is the package manager for Rust.
cargo buildfor buildingCargo.tomlwhich is the build config filecargo checkfor running testscargo runfor running project executablecargo new name --bincan be used for initializing a new binary crate or--libfor a new library crate- cargo creates a target folder for temp and target files