Sunday, July 07, 2024

Variance in Rust

I recently presented a slideshow on the subject of "Variance in Rust: Covariant, Contravariant, and Invariant".  My thanks to Cameron Dershem, the Organizer of the Indy Rust Meetup, for inviting me to speak to the group.  This was an updated version of the talk that I gave to Dallas Rust User Meetup (DRUM) a few weeks before.

In my talk, I introduced the terminology and showed some basic code examples.  An ending slide includes links to where I learned about this topic so that interested Rustaceans can dig in deeper.  You can download the presentation slides in PDF format from my Rust and WebAssembly research page.

Friday, March 08, 2024

Programming Rust

It took me a few months but I finally finished reading the O'Reilly book Programming Rust Second Edition (2e) authored by Blandy, Orendorff, and Tindall.  I see now that there is also a "Revised 2nd Edition" which "Covers Rust 2021 Edition" meaning Rust 1.56 or later.  The edition I read "Covers Rust 1.50" so it is probably not much different.

I started recommending this book even before I finished reading it.  If you could only read one Rust book, this would be it.  Since you can read more than one Rust book, I would start with The Rust Book and then read "Programming Rust" sometime before you pick up Rust for Rustaceans.

The cover subtitle is "Fast, Safe Systems Development" and the book does appear to be written for those already familiar with systems programming.  I was grateful to the authors that some of the more advanced concepts expressed in their example code included diagrams to accompany the in-depth explanations.  This might be the intermediate-level Rust book that you were looking for.

This 700+ page book is big but O'Reilly has published bigger.  The Fourth Edition of O'Reilly's "Java in a Nutshell" was almost one thousand pages.  In a review that I wrote many years ago, I joked that "over the years this 'in a nutshell' book has expanded to fill the size of a coconut".

The physical bulk of "Programming Rust" is such that it can be less comfortable to handle while reading.  For the next edition, my advice to the authors is that they split the book into two volumes when they add content.  I can see that the authors have already arranged the chapters such that the more esoteric material comes later which could work well for a second volume.

My next read might be the recently published PacktPub book Asynchronous Programming in Rust by Carl Fredrik Samson.  The quality of PacktPub books can be hit-or-miss but this looks like a good one.  I am also eagerly anticipating a wave of new Rust books, hopefully including a Third Edition of "Programming Rust", when the 2024 Edition of the Rust programming language is released later this year.


Wednesday, January 10, 2024

Advent of Spin 2023

Recently I participated in the Advent of Spin 2023, an annual holiday-themed coding challenge hosted by Fermyon.  I wrote Rust code, compiled it to WebAssembly (Wasm), and then deployed the code as Function-as-a-Service (FaaS) serverless components running in the Fermyon Cloud.  The source code is available from my GitHub repository advent-of-spin.

Yesterday I presented a slideshow to the Dallas Rust User Meetup (DRUM) in which I described my solutions to the coding challenges.  This was in preparation for my being the guest speaker today on the YouTube show Fermyon Cloud Office Hours.  My thanks to the DRUM Members (DRUMMers) for their attention and feedback and my thanks to the employees of Fermyon for running this event.