andybalaam

joined 3 years ago
2
submitted 7 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Going through some exercises on Rust ownership, references, slices and error handling.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2024 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 8 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

What a String is in Rust, and how they differ from &str. Strings are resizeable arrays of bytes that are guaranteed to be in UTF-8 format. &strs are references to chunks of bytes that are also guaranteed to be in UTF-8 format.

If you want to learn more about UTF-8 and character encodings, check out my video Interesting Characters.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2024 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 8 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Explanation of some of the most commonly used types in Rust: Vecs, which store lists of items, Boxes that allow us to own things that we keep on the heap, and slices that are a way of referring to parts of Vecs or arrays without owning them.

In case you're interested, the bug that Andy found mid-recording(!) in the slides was fixed in https://github.com/tweedegolf/101-rs/issues/97 .

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2024 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 8 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

This time we discuss how to add methods to structs and enums, using impl blocks. Methods work similarly to other languages, but it might be a surprise that they can be defined inside separate blocks, and in fact they can be defined in multiple different blocks, which can be useful, and can also be a potential cause of confusion!

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2024 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

 

We learnt about enums and generics last time, which means we're ready to talk about Result, which is a really nice way of handling errors in Rust, that allows you to be very explicit about what went wrong, but also with a very compact syntax using the ? operator. Before that we discuss panic!, which essentially stops your program with an error message, and is useful for handling errors that should never happen.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2024 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 11 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Continuing our review of the things you need in Rust to write programs - grouping together data using structs, and allowing multiple possibilities with enums. We look at how to decide which thing you've got with the match keyword, and review a very popular enum called Option, which lets you say either you've got something, or you've got nothing.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 11 months ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Starting some more advanced Rust programming ideas by looking at references - the ability to "borrow" values and refer to them without taking ownership. We look at mutable and immutable references, and the rules about references that prevent us ever having an "invalid" reference that points at something that has been dropped or changed.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 1 year ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Going through some exercises on basic Rust syntax and ownership.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 1 year ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Continuing on Rust programming basics by looking at ownership and memory management, including the stack and the heap: what they are, how they differ, and why you need to care.

For more help on ownership and the stack and the heap, try Chapter 4 of the Rust book.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 1 year ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

An introduction to the Rust language basics.

  • What Rust is and why you might want to learn it
  • Examining a simple program
  • Learning about the types of variable you can have (numbers, strings, tuples, arrays)
  • Introducing control flow with if, for, while and loop
  • Talking about functions and expressions
  • Preparing ourselves for the next video, which is about memory management

If you'd like to learn more about Unicode and character sets, try my video Interesting Characters where I share how surprisingly interesting this whole area is.

Links:

Rust 101 is a series of videos explaining how to write programs in Rust. The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

2
submitted 1 year ago* (last edited 7 months ago) by [email protected] to c/[email protected]
 

Introducing the Rust 101 series and how to install Rust.

Rust 101 is a series of videos explaining how to write programs in Rust.

How to install Rust: https://rustup.rs/ Slides: http://artificialworlds.net/presentations/rust-101/0-intro Exercises: https://101-rs.tweede.golf/0-install/mod.html

Follow the "Exercises" link to find the other tools you might want to install to follow along.

The course materials for this series are developed by tweede golf. You can find more information at https://github.com/tweedegolf/101-rs and you can sponsor the work at https://github.com/sponsors/tweedegolf . They are released under the Creative Commons Attribution Share Alike 4.0 International license.

This series of videos is copyright 2023 Andy Balaam and the tweede golf contributors and is released under the Creative Commons Attribution Share Alike 4.0 International license.

1
submitted 3 years ago* (last edited 10 months ago) by [email protected] to c/[email protected]
 

NOTE: my ideas have changed quite a bit since I recorded this, especially about the idea that "every crime requires a punishment". If you'd like to explore more, try this sermon by my friend Jörg.

Andy Balaam departs from programming languages to outline the main ideas in Christianity, from a personal perspective, and outlines some problems and questions. The ideas include: God exists and is a person, God made the world good and it went wrong, a sacrifice was needed and God made it, and we respond. The problems and questions include why suffering exists, and why we would believe this particular thing when there are so many choices.

Slides and more info here: http://www.artificialworlds.net/blog/2016/05/18/basic-concepts-of-christianity-video/

view more: next ›