Author: Andy Balaam

  • Converting a string to an int in Rust (for no reason)

    How about a little light relief? Let’s convert a string to an int in Rust. Follow me on mastodon: @andybalaam@mastodon.social

  • Why I don’t use AI (expanded)

    Soon after I wrote Why I don’t use AI, I researched and submitted a significantly longer version to ACCU’s Overload journal. It has now been published! You can read it here: Why I don’t use AI (Overload). It contains references to a lot more sources, a…

  • Resizing and moving an encrypted LVM volume

    I use a LUKS-encrypted LVM setup for my laptop. Within the encrypted volume I have partitions for / and /home and I guessed the sizes wrong, so I needed to change them. I did various reading, and even resized some filesystems and partitions, before I d…

  • Implementing FizzBuzz in Rust (for no reason)

    Things getting you down? Let’s implement FizzBuzz. It should be low stress because it’s not a difficult task, but maybe we can think about some nice ways to make it work. Follow me on mastodon: @andybalaam@mastodon.social

  • Reversing a string in Rust (for no reason)

    Feeling slightly exhausted by the world? Let’s reverse a string in Rust in a needlessly complicated way. I was expecting to make a tiny simple video and ended up going further into unsafe than I ever have before, which was an unexpected treat. Let me k…

  • Mini-rust in Rust 050: Parsing function definitions

    To make real programs, we will need functions. We’ll start off by allowing you to define functions that take no arguments. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Why do I have 2 passwords? How to talk about encryption in Matrix

    Most modern software applications give total trust to the service provider. End-to-end encrypted (E2EE) services are different: the service provider is a gateway, and the real trust is with other people. This is unfamiliar, and can make using E2EE con…

  • Invisible Crypto: can Matrix be both secure and easy to use?

    The Invisible Crypto initiative intends to make Matrix easier to use by ensuring that encrypted messaging is secure by default, and the user is not bothered by irrelevant information. In this talk we will give a status update, hopefully explaining why…

  • Mini-rust in Rust 049: Lexing an empty function

    The next big thing we need to be able to do is define functions. Let’s start by lexing the fn keyword and brackets: we’re going to need both of those. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworld…

  • Mini-rust in Rust 048: Handling variable scope

    Variables should be defined inside their curly braces and not elsewhere, and it should be fine to “shadow” variables by defining new ones inside a smaller scope. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at arti…

  • Mini-rust in Rust 047: Updating types as we get more information

    If we know that y is an f64, when we see x *= y, we can guess that x is an f64 too. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Jez and Andy write a Parser

    My friend Jez is back, and we make a start on a parser for the Cell language (in Rust, of course). You can find Jez at jezuk.co.uk and follow him at @jezhiggins@mastodon.me.uk. Soon after we finished recording, Jez reported to me that he’d got it pass…

  • Jez learns Rust by writing a Lexer

    My friend Jez joins us and we talk about his new implementation of my Cell programming language in Rust, which is his first from-scratch Rust project. You can find Jez at jezuk.co.uk and follow him at @jezhiggins@mastodon.me.uk.

  • Mini-rust in Rust 046: Type-checking mutations

    When we see x *= 1.3 we need to check that x is a float – otherwise this is a compile error. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 045: Combining two types when we add things

    We had a weird hack in place to handle the type of an expression like x + 3 but now we can do better. Let’s do it! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Why I don’t use AI

    I choose to avoid using “AI” (by which I mean Large Language Models). Here’s why: They have a devastating environmental impact. 1 2 They are trained by exploiting and traumatising millions of low-paid workers. 3 4 They produce biased and dangerously i…

  • Mini-rust in Rust 044: Finding the type of a symbol

    If we write let x: i32 = 3; then we should know that x is an i32, right? Let’s make it so! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 043: Expressions on the left of operators

    The final (for now) side mission before we get back onto type-checking variables: allowing complex expressions to exist before operators. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 042: An unexpected token means stop this expression

    We’re on our way towards type-checking variables, but first we take another detour into parsing expressions: if we hit an unexpected token, we should backtrack and return what we found so far, not just stop with an error. You can find the source code …

  • Mini-rust in Rust 041: While conditions that are not operations

    We are starting down a road towards type checking variables, but we go on a detour to make sure we can parse the simplest possible condition in a while loop, which it turns out we missed. You can find the source code at codeberg.org/andybalaam/milk an…

  • Mini-rust in Rust 040: While conditions should be bool

    Working up towards some difficult type-checking, we do some easy type-checking: the condition part of a while condition should be a boolean, and to get there we need to improve the type we give to the result of an operation. You can find the source co…

  • Mini-rust in Rust 039: Spans should be ranges

    We’ve been tracking the location of a token in the file using a pair of numbers, but Rust has a better way: a Range. After some debate and wandering, we make the code a little better with this change. The interlude music is Blood, Collateral, & Oth…

  • Mini-rust in Rust 038: Avoiding a String allocation for each token

    Last time I described what I tried to do with removing the extra String stored in each Token. This time, having figured out a workaround, we go ahead and remove them. Of course, it’s more complicated than we expected. You can find the source code at c…

  • Mini-rust in Rust 037: Complex expressions in mutation statements

    We left a lot of gaps while we were building towards some working code. The first to tackle is allowing complex expressions on the right-hand side of mutation statements. You can find the source code at codeberg.org/andybalaam/milk and more of my stuf…

  • Mini-rust in Rust 036: Evaluating code blocks

    Blocks of code surrounded by braces are valid statements in Rust – it’s just a small change to our existing code to be able to evaluate them. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 035: Tidying up the evaluator

    We left quite a few messes behind in our evaluator – let’s get rid of some refs, stop returning multiple values in our test code, and handle blocks similarly to other code. You can find the source code at codeberg.org/andybalaam/milk and more of my st…

  • Mini-rust in Rust 034: Our first program, actually working

    It’s finally here – our mini-program to calculate factorials, featuring a while loop and mutable variables, is working! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 033: Evaluating operators like plusequals and timesequals

    Our while loop is close … first we need to be actually calculate new values for variables when we see a += or *= operator. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 032: Supporting a Unit type and type checking mutations

    We’ve been putting off creating a Unit type, (), and we need our type checker to be OK with += etc. We are getting excitingly close to having a working while loop! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at ar…

  • Mini-rust in Rust 031: Getting “while” through the type checker

    Our while loop now parses, but it doesn’t make its way through the type-checker unscathed. We’re not quite ready to do real type checking here, but we need to pass this code through so we can actually run it! You can find the source code at codeberg.o…

  • Mini-rust in Rust 030: Expressions after while loops

    It turns out we are making a bad assumption in our parser: that every statement ends with a semicolon. That’s not quite right – for example, while loops can form statements, but they don’t need to be ended with a semi-colon. Let’s fix the bug! You can…

  • Mini-rust in Rust 029: Parsing plus-equals

    This is the first time we are handling modifying variables, so our current “assignment” parser, which looks for a let keyword is no help – we need a new bit of parsing for modification statements. You can find the source code at codeberg.org/andybalaa…

  • Mini-rust in Rust 028: Lexing plus-equals

    Adding another two-character operator to our lexer, which is surprisingly more complicated than I expected. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Standing again for the Matrix Governing Board

    I am standing for re-election to the Matrix Governing Board (see the election announcement). The Governing Board advises and oversees the work of the Matrix Foundation. I will stand as an Individual Member again, not representing a company or project. …

  • Testing nonexistence

    Testing that something is not there can be unreliable Today I am writing a test that something does not happen, like this: Given that the A setting is "off" When I start the app Then the warning about A being on IS NOT displayed It’s quite…

  • Mini-rust in Rust 027: Parsing blocks of code

    We can already parse empty while loops, but now we figure out how to parse the block of code that forms the body of the loop. It should be useful for other things including (eventually) function bodies. You can find the source code at codeberg.org/and…

  • Mini-rust in Rust 026: Parsing an empty while loop

    The little real-world snippet we are trying to get working includes a while loop – let’s try to get it to parse. For now, only if the actual loop body is empty. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artif…

  • Mini-rust in Rust 025: Parsing let mut

    Continuing trying to get the simplest bit of real code we could think of to work, we need to finish off less-than-or-equals, and also make let mut work. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialwor…

  • Mini-rust in Rust 024: Lexing the <= sign

    Now we’re going to try and get a little code snippet that calculates factorials to work. First up: lexing the <= sign! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 023: Refactor to share structure of the syntax tree

    We are repeating ourselves with the SyntaxTree and TypedSyntaxTree enums. I thought the solution would be too complex, but on reflection it’s fine, so let’s share that code. You can find the source code at codeberg.org/andybalaam/milk and more of my s…

  • Rust tracing basic setup

    I spent ages yesterday trying to figure out how to use Rust’s tracing library (and tracing-subscriber) for a very simple logging use-case. I wanted to use tracing because a) it’s rapidly becoming standard everywhere and b) I was using libraries that us…

  • Mini-rust in Rust 022: Stop lying about types in errors

    Now that we have the types we calculated in our syntax tree, use them to stop faking it in error messages – replace a hard-coded “integer” with the actual type of the expression we are talking about. You can find the source code at codeberg.org/andyba…

  • Mini-rust in Rust 021: Including type information in our syntax tree

    We realised last time that our type checker needs to move on from just saying “yes” or “no” for whether our program is OK: we need to keep hold of the type information we work out, so we can use it for error messages and possibly even within the evalua…

  • Mini-rust in Rust 020: Gaps in our type checker

    The type checker is passing our unit tests, but it’s stopping our language from actually working. Time to fill in the gaps. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 019: Type checking an actual type error

    We have a plan for what error message we should get when we try to write code like let x: i32 = 3.0;. Let’s try to make it a reality! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 018: Type checking, the happy path

    This is it: we’re going to do some actual type-checking. We want to be able to identify that let x: i32 = 3.0; is wrong, but for now we’re going to check some things that are right. Type-checking this kind of thing is way easier than the full type infe…

  • Mini-rust in Rust 017: Handling float literals

    We’re still on a mission to do some type-checking, and our plan is to allow writing let x: i32 = 3.0;, then produce a type error because 3.0 is not an integer that can be stored in an i32. The last piece of the puzzle is to be able to handle the 3.0 bi…

  • Mini-rust in Rust 016: Tidying our parser

    We left our parser in an awful mess after the last video, so we’re going to tidy it up a bit and make it easier to understand. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 015: Parsing a typed assignment

    We want to have a go at some type-checking, so the first step is to write some code that causes a type error. We are going for let x: i32 = 3.0;. To do that, we need to be able to lex and parse the : i32 part… You can find the source code at…

  • Mini-rust in Rust 014: Evaluating an assignment

    Finally, we are going to execute a real piece of code that actually looks like a programming language! We are setting a variable to a value, and then using that variable later on… You can find the source code at codeberg.org/andybalaam/milk and more…

  • Mini-rust in Rust 013: Fixing a bug in our lexer

    We have been putting up with a weird problem with our lexer: up to now it requires white space between each token. But, last time we created a backtracking iterator that we can use to fix this problem, so let’s go ahead and do it. You can find the sou…

  • Mini-rust in Rust 012: Parsing with backtracking

    We’ve built a toy parser, but it’s not going to last us. We need to make it a bit more proper. Specifically, we need to be able to look ahead, and then backtrack. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at art…

  • Mini-rust in Rust 011: Parsing an assignment plus expression

    Last time we lexed an assignment statement. This time: parsing it, so we’re ready to execute it! You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 010: Lexing an assignment

    We’re ready to lex a proper statement: specifically a “let” statement that will give a variable its value. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 009: Handling parsing errors

    Our parser kinda works, but it needs some work to be less terrible. We’ve realised we did a few things in awkward or wrong ways, so let’s fix them before they get out of hand. You can find the source code at codeberg.org/andybalaam/milk and more of my…

  • Mini-rust in Rust 008: Refactoring our parser

    Our parser kinda works, but it needs some work to be less terrible. We’ve realised we did a few things in awkward or wrong ways, so let’s fix them before they get out of hand. You can find the source code at codeberg.org/andybalaam/milk and more of my…

  • Mini-rust in Rust 007: Evaluating an operation

    Now that we can parse things, let’s evaluate them. By the end of this, we should be able to use our little language as a mini-calculator (only for adding up so far though). You can find the source code at codeberg.org/andybalaam/milk and more of my st…

  • Mini-rust in Rust 006: Parsing an operation

    We’re finally ready to parse things! Our lexer can do almost enough to allow us to handle “3 + 5”, so we’ll make that ready, and then parse that expression into a syntax tree. You can find the source code at codeberg.org/andybalaam/milk and more of my…

  • Message order in Matrix: right now, we are deliberately inconsistent

    After lots of conversations with Element colleagues about message order in Matrix, and lots of surprises for me, I wanted to write down what I had learned before I forgot, and also write down some principles I think we should try to follow. A lot of th…

  • Mini-rust in Rust 005: Making our lexer an iterator

    Our lex function returns an iterator, but in the implementation we were faking it. Let’s do it properly. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 004: Refactoring our lexer

    Refactoring our lexer, so all the awful things we did to make the tests pass are behind us. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 003: Much prettier errors

    More of the very basic structure of our interpreter: making the error messages from the lexer point at the exact line of code, in a pretty way. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 002: Errors while lexing

    Continuing writing our mini-rust in Rust. Figuring out how to throw an error when lexing goes wrong. You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net

  • Mini-rust in Rust 001: Lexing an int

    Introducing my new series: writing a little Rust-like language in Rust. It will be an interpreted language, and (for now at least) it will try to work as much like real Rust as possible. Maybe one day it will be a useful language, but for now it’s pure…

  • Mini-rust in Rust 001: Lexing an int

    Introducing my new series: writing a little Rust-like language in Rust. It will be an interpreted language, and (for now at least) it will try to work as much like real Rust as possible. Maybe one day it will be a useful language, but for now it’s pure…

  • Rust 101 – 53: Exercises for module G (q4)

    Creating a custom Python extension in Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe, FFI This section (FFI): 49: FFI, 50: Exercise 1, 51: Exercise 2, 5…

  • Rust 101 – 52: Exercises for module G (q3)

    Using cargo-bindgen to generate bindings, automating what we need to do to use existing C code inside a Rust project. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, …

  • Rust 101 – 51: Exercises for module G (q2)

    Trying out calling Rust code from with a C program (should help with calling Rust from any compiled-to-native language too). Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, …

  • Rust 101 – 50: Exercises for module G (q1)

    Calling C code from Rust, Rust code from C-family languages, using cargo-bindgen, and creating Python extensions. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsa…

  • Rust 101 – 49: Foreign function interfaces (interacting with other languages)

    Calling C code from Rust, Rust code from C-family languages, using cargo-bindgen, and creating Python extensions. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsa…

  • 19 years of blogging

    As you may have noticed, I recently upgraded my blog from WordPress to Zola. This means that my home computer does the work of rendering the pages to HTML once, and my web server only has to provide the rendered HTML to your browser. This should mean t…

  • Deployment is important

    I just evaluated and installed software for providing comments and statistics for this blog. Here are my experiences of the deployment process: A Python comment system. Uses one of the 17 outdated installer/packaging systems for Python (none of which…

  • Rust 101 – 48: Exercises for module F (q3)

    Implementing our own Result type that has a specific memory layout, so it can be used by Roc code. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section…

  • Rust 101 – 47: Exercises for module F (q2)

    Wrapping a C function with safe Rust code. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe?, 43: Meaning of unsafe, 44: Un…

  • Heads-up: moving away from WordPress

    This is an early warning: I am actively working to move this blog away from WordPress, to a static site created using Zola. I am planning to keep as many URLs working as humanly possible, and the RSS feed URL should be unchanged. (With any luck, the permalinks inside will also be unchanged, but I…

  • Heads-up: moving away from WordPress

    This is an early warning: I am actively working to move this blog away from WordPress, to a static site created using Zola. I am planning to keep as many URLs working as humanly possible, and the RSS feed URL should be unchanged. (With any luck, the pe…

  • Rust 101 – 46: Exercises for module F (q1)

    Coding up a linked list based on raw pointers in Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe?, 43: Meaning of unsafe, 44: Undefined behaviour, 45: Unsafe types, 46: Exercise 1 Links: Slides: Rust 101 – module F Exercises:…

  • Rust 101 – 46: Exercises for module F (q1)

    Coding up a linked list based on raw pointers in Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe?, 43: Meaning of un…

  • Rust 101 – 45: Unsafe types and examples

    Looking through some of the types of code you will be working with if you’re doing unsafe Rust, and some of the unsafe types you might want to use. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe?, 43: Meaning of…

  • Rust 101 – 45: Unsafe types and examples

    Looking through some of the types of code you will be working with if you’re doing unsafe Rust, and some of the unsafe types you might want to use. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and paral…

  • Rust 101 – 44: Undefined behaviour

    If you write unsafe Rust, you need to reason about “undefined behaviour”. We talk through what that means, and try to develop an intuition about why we can’t predict how our program will behave if we don’t follow the rules. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects,…

  • Rust 101 – 44: Undefined behaviour

    If you write unsafe Rust, you need to reason about “undefined behaviour”. We talk through what that means, and try to develop an intuition about why we can’t predict how our program will behave if we don’t follow the rules. Series: Language basics, Mo…

  • Rust 101 – 43: The two meanings of “unsafe” in Rust

    The `unsafe` keyword in Rust means two things: “You must read the docs!” or “I promise I read the docs and followed the rules!”. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe?, 43: Meaning of unsafe Links: Slides: Rust 101…

  • Rust 101 – 43: The two meanings of “unsafe” in Rust

    The unsafe keyword in Rust means two things: “You must read the docs!” or “I promise I read the docs and followed the rules!”. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects…

  • Rust 101 – 42: Why do we need unsafe?

    There is a special mode in Rust programs called unsafe – why do we need it? Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsafe? Links: Slides: Rust 101 – module F Exercises: artificialworlds.net/presentations/rust-101/exercises/F-safe-unsafe/mod.html The course materials for this series are…

  • Rust 101 – 42: Why do we need unsafe?

    There is a special mode in Rust programs called unsafe – why do we need it? Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 42: Why unsaf…

  • Rust 101 – 41: Exercises for module E (q2b)

    Writing a mini client to connect to our async Rust chat server. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async This section (Async): 34: What is async?, 35: Futures, 36: async/await, 37: Runtimes, 38: Exercise E1a, 39: Exercise E1b, 40: Exercise E2a, 41: Exercise E2b Links: Slides:…

  • Rust 101 – 41: Exercises for module E (q2b)

    Writing a mini client to connect to our async Rust chat server. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 34: What is async?, 35: F…

  • Rust 101 – 40: Exercises for module E (q2a)

    Writing a little chat server in async Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async This section (Async): 34: What is async?, 35: Futures, 36: async/await, 37: Runtimes, 38: Exercise E1a, 39: Exercise E1b, 40: Exercise E2a, 41: Exercise E2b Links: Slides: Rust 101 – module…

  • Rust 101 – 40: Exercises for module E (q2a)

    Writing a little chat server in async Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 34: What is async?, 35: Futures, 36: async/aw…

  • Rust 101 – 39: Exercises for module E (q1b)

    Writing a one-shot queue using async Rust, this time with a little less help. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async This section (Async): 34: What is async?, 35: Futures, 36: async/await, 37: Runtimes, 38: Exercise E1a, 39: Exercise E1b, 40: Exercise E2a, 41: Exercise E2b…

  • Rust 101 – 39: Exercises for module E (q1b)

    Writing a one-shot queue using async Rust, this time with a little less help. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 34: What is…

  • Rust 101 – 38: Exercises for module E (q1a)

    Writing our own multi-producer-single-consumer (MPSC) queue using async Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async This section (Async): 34: What is async?, 35: Futures, 36: async/await, 37: Runtimes, 38: Exercise E1a, 39: Exercise E1b, 40: Exercise E2a, 41: Exercise E2b Links: Slides: Rust 101 –…

  • Rust 101 – 38: Exercises for module E (q1a)

    Writing our own multi-producer-single-consumer (MPSC) queue using async Rust. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and parallelism, Trait objects, Async, Unsafe This section (Async): 34: What is…

  • Rust 101 – 37: Async runtimes

    We talked about how Futures have poll methods, but who calls them? That is the job of the runtime. We talk about how to launch your async code and how to choose the right runtime, and then we have a very brief look at some Web frameworks that are based on async Rust. Series: Language…

  • Rust 101 – 37: Async runtimes

    We talked about how Futures have poll methods, but who calls them? That is the job of the runtime. We talk about how to launch your async code and how to choose the right runtime, and then we have a very brief look at some Web frameworks that are based…

  • Rust 101 – 36: What async and await really do

    Attempting to explain as slowly as possible what actually happens when the compiler finds an async function containing awaits: it writes a poll method for you to create something that implements Future. The generated poll method polls the Futures you asked to await, in order. The interesting bit is that this generated thing that implements…

  • Rust 101 – 36: What async and await really do

    Attempting to explain as slowly as possible what actually happens when the compiler finds an async function containing awaits: it writes a poll method for you to create something that implements Future. The generated poll method polls the Futures you a…

  • Rust 101 – 35: Futures

    Exploring what a Future is in async Rust and how we could manually write code that polls futures. Normally, we avoid this manual work by using the `async` and `await` keywords, but looking into this helps us understand what those keywords really do. Series: Language basics, More syntax, Traits and generics, Building applications, Concurrency and…

  • Rust 101 – 35: Futures

    Exploring what a Future is in async Rust and how we could manually write code that polls futures. Normally, we avoid this manual work by using the async and await keywords, but looking into this helps us understand what those keywords really do. Serie…