rust match

match Control flow construct Rust has an extremely powerful control flow construct called match that allows you to compare a value against a series of patterns and then execute code based on which pattern matches. Patterns can be made up of literal values, variable names, wildcards, and many other things. Think of a match expression as being like a coin-sorting machine: coins slide down a track with variously sized holes along it, and each coin falls through the first hole it encounters that it fits into. In the same way, values go through each pattern in a match, and at the first pattern the value “fits,” the value falls into the associated code block to be used during execution. ...

July 31, 2025 · 3 min · Kristian Alexander P

Rust Ownership

Understanding Ownership Ownership is Rust’s most unique feature and has deep implications for the rest of the language. It enables Rust to make memory safety guarantees without needing a garbage collector, so it’s important to understand how ownership works. In this chapter, we’ll talk about ownership as well as several related features: borrowing, slices, and how Rust lays data out in memory.

July 31, 2025 · 1 min · Kristian Alexander P

rust resources

Rust free and online resources Links https://www.youtube.com/@letsgetrusty

July 31, 2025 · 1 min · Kristian Alexander P

rust variables

Immutable By default rust variables are immutable. Once a value is bound to a name, you can’t change that value. We can make a mutable variable using the keyword mut. fn main() { let mut x = 5; println!("The value of x is: {x}"); x = 6; println!("The value of x is: {x}"); } The value of x is: 5 The value of x is: 6 Constant. Like immutable variables, constants are values that are bound to a name and are not allowed to change, but there are a few differences between constants and variables. First, you aren’t allowed to use mut with constants. Constants aren’t just immutable by default—they’re always immutable. You declare constants using the const keyword instead of the let keyword, and the type of the value must be annotated. We’ll cover types and type annotations in the next section, “Data Types”, so don’t worry about the details right now. Just know that you must always annotate the type. ...

July 31, 2025 · 3 min · Kristian Alexander P

haskell

Haskell is a general-purpose, statically typed, purely functional programming language. It is known for its strong emphasis on functional programming principles and features like type inference and lazy evaluation. Purely Functional In Haskell, functions are treated as mathematical functions, meaning they always produce the same output for the same input and have no side effects (they do not modify external state). Statically Typed The type of variables and expressions is checked at compile time, catching many potential errors before runtime. Haskell also features strong type inference, allowing the compiler to deduce types without explicit declarations in many cases. ...

July 29, 2025 · 1 min · Kristian Alexander P

programming

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages are used to create computer programs, which implement algorithms. Key characteristics and concepts of programming languages include: Syntax The set of rules that defines the combinations of symbols that are considered to be correctly structured statements or expressions in the language. Semantics The meaning of the instructions and how they are executed by the computer. ...

July 29, 2025 · 1 min · Kristian Alexander P

python

Python is a high-level, interpreted, general-purpose programming language. It is known for its clear and readable syntax, which emphasizes code readability and reduces the cost of program maintenance. Key characteristics of Python: Interpreted Python code is executed line by line by an interpreter, without the need for a separate compilation step. This speeds up the development process, as changes can be tested immediately. High-level Python abstracts away low-level details of computer hardware, allowing developers to focus on problem-solving rather than managing memory or system resources. ...

July 29, 2025 · 1 min · Kristian Alexander P

rust

Rust is a modern, general-purpose programming language known for its emphasis on performance, memory safety, and concurrency. It is designed to build reliable and efficient software, particularly in areas where performance is critical, such as systems programming, game engines, databases, and operating systems. Key characteristics of Rust include: Performance Rust offers speed and memory efficiency without requiring a runtime or garbage collector, making it suitable for low-level systems programming. Memory Safety Rust’s unique ownership model and borrow checker enforce memory safety at compile time, preventing common errors like null pointer dereferences and data races without the overhead of a garbage collector. ...

July 29, 2025 · 1 min · Kristian Alexander P

rust data types

Data types forrust. Every value in Rust is of a certain data type, which tells Rust what kind of data is being specified so it knows how to work with that data. Keep in mind that Rust is a statically typed language, which means that it must know the types of all variables at compile time. Scalar Types A scalar type represents a single value. Rust has four primary scalar types: integers, floating-point numbers, Booleans, and characters. You may recognize these from other programming languages. Let’s jump into how they work in Rust. ...

July 29, 2025 · 6 min · Kristian Alexander P

rust struct

Rust structs are similar to tuples, in that both hold multiple related values. Like tuples, the pieces of a struct can be different types. Unlike with tuples, in a struct you’ll name each piece of data so it’s clear what the values mean. Adding these names means that structs are more flexible than tuples: you don’t have to rely on the order of the data to specify or access the values of an instance. ...

July 29, 2025 · 1 min · Kristian Alexander P