Wednesday, February 11, 2026

Rust Bookclub: Deep Learning

Last year, the Rust Readers Discord Discussion bookclub covered three Rust books at the pace of one chapter a week:

Of these three books, I think Rust Atomics and Locks is the best.  This book is available both in print and freely available from the author's website.  I recommend reading Rust Atomics and Locks prior to reading Async Rust to get the concepts in prerequisite order.

Based on the interests of the bookclub attendees, I think future books that we cover will focus on Artificial Intelligence and Machine Learning (AI/ML), particularly Deep Learning and Generative AI (GenAI).  When I went looking for Rust books that covered these topics, I came across so much AI slop that I concluded that I needed to recommend something from a reputable publisher.  I received confirmation tonight of the publication of the Apress book Deep Learning with Rust: Mastering Efficient and Safe Neural Networks in the Rust Ecosystem by Mehrdad Maleki.

If you want to join us online via Discord for the discussion of Deep Learning with Rust (DLwR), please join the Dallas Rust User Meetup (DRUM) to receive event notices.  We will probably get started in mid-March.  We might go a bit slower with this book, maybe two chapters a month.


Tuesday, December 23, 2025

Dioxus 0.7 Updates

I updated my Rust-Dioxus Project Setup tutorial to support Dioxus version 0.7.  This step-by-step tutorial shows you how to build a Dioxus v0.7 web application with the static site generation (SSG) option for static pre-rendering and client-side hydration.  SSG lets you distribute your Single Page Application (SPA) from a Content Delivery Network (CDN) instead of a server while still supporting Search Engine Optimization (SEO).
 
The techniques described in the tutorial are used in the updated CroftSoft Dioxus Prototype.  This application includes an Animation demonstration in which the updates are locked to the screen refresh rate by repeatedly requesting an animation frame.  The code for this open source project is available from GitHub.
 

Sunday, March 02, 2025

Rust + Wasm = Mobility

Recently I gave a slideshow presentation on "Rust / Wasm: On Serverless & Frontend" to the Rust Miami Meetup.  My thanks to the Meetup organizer Eugenio Alvarez for inviting me to be a speaker.  You can download a copy of the slide deck in PDF format from my Rust and WebAssembly research webpage.

Eugenio is also the Organizer of the Miami Java User Group.  Back around the period of the dot-com boom, I used to be the leader of a number of Java User Groups (JUGs), including the Game Developers Java User Group and the Silicon Valley Java User Group (SVJUG).  These days I am seeing some of the same energy around Rust that I saw with Java back then.

When I first started with Java back in 1996, I would get hired by small software publishers of Web browser and desktop applications.  They wanted code that could run on Apple Macintosh, Microsoft Windows, Netscape Navigator, and Internet Explorer.  Java could do that because it could run on any platform with a Java Virtual Machine (JVM) runtime.

WebAssembly (Wasm) is the new JVM.  Whereas Java no longer runs in the browser, Wasm runs on all platforms including desktop, server, and serverless.  It is also comes wrapped in a security sandbox, which I appreciate from my past experience some decades ago implementing Java-based mobile agent frameworks.

Speaking of mobile, using a programming language that can run on any platform gives software developers career mobility.  Right now, Rust is the best language to use to write applications compiled to Wasm.  That is why I say:

Rust + Wasm = Mobility

 

Friday, September 06, 2024

Typestate Pattern

I recently gave a slideshow presentation that I entitled "Typestate Pattern in Rust: With Fluent Constructor and State Machine Examples".  My thanks again to Cameron Dershem, the Organizer of the Indy Rust Meetup, for giving me the opportunity to speak to his group a second time.  I also thank the members of the Dallas Rust User Meetup (DRUM) for letting me practice initial drafts of my talk on them at our semimonthly online meetings.

In my talk, I started by providing the contexts for using the typestate pattern before digging into the implementation details as demonstrated by the examples in my open source code repository.  By working daily on the code examples for a month, I reached the point where I finally feel like I understand typestate and its variations.  You can download the presentation slides in PDF format from my Rust and WebAssembly research page.


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.

 

Friday, December 01, 2023

Rust in the Cloud

For the frontend, I have had some good success recently using the Rust-based user interface framework Dioxus to create web applications.  Now I am exploring using Rust on the backend with serverless cloud technologies such as Fermyon Spin and Cargo-Lambda.  You can check out what I have so far in my new GitHub repositories spin-prototype and cargo-lambda-prototype.

Yesterday when I tuned in to watch the livestream of the Amazon Web Services (AWS) re:Invent 2023 conference keynote by the Chief Technology Officer (CTO) of Amazon.com Dr. Werner Vogels, I suspected I might hear something about Rust because the AWS Software Development Kit (SDK) for Rust had just transitioned from Developer Preview to General Availability a couple of days before.  To my delight, Dr. Vogels made the case for switching from Java to Rust in the cloud for reasons of cost and sustainability.  You can watch his presentation on this topic at the one hour mark in the YouTube video recording.


Friday, October 20, 2023

Dioxus Prototype

Previously I made web application prototypes using the Rust-based front-end frameworks Sycamore and Yew.  With the recent release of Dioxus version 0.4, I updated my Dioxus Prototype.  It demonstrates capabilities such as animation, form inputs, and static prerendering.

Saturday, September 23, 2023

Rust-Dioxus Project Setup

Previously I used Angular to make Single Page Application (SPA) websites in the TypeScript programming language.  I then used the Angular tool Scully to statically prerender the SPA webpages for Search Engine Optimization (SEO) and to be able to distribute the website code from a Content Delivery Network (CDN) instead of a web server.  When I switched over to the Rust programming language last year, I needed to learn new ways of doing things.

After a lengthy quest in which I explored a number of nascent Rust-based SPA libraries, I have finally figured out how to make this work which I have documented with step-by-step instructions in my new tutorial Rust-Dioxus Project Setup.  A few months ago I became the Organizer of the Dallas Rust User Meetup (DRUM) so I have created a website for that group that provides an online example of the techniques described in the tutorial.  I will be updating the tutorial over the next few months as my understanding of Dioxus improves in the process of converting my old websites.


Monday, August 28, 2023

Rust Podcast Duos

I updated my list of Rust Podcasts with two new entries:

I have listened to all eleven episodes so far of "Way of the Crab" and just started "Rust Workshop".  Both of these podcasts feature a co-host duo but each podcast has its own distinct personality.


Sunday, July 23, 2023

Rust Mars

I am currently working on converting to the Rust programming language yet another Java applet that I originally wrote a couple of decades ago.  Mars is a tank combat game which provides a demonstration of the use of my Rust-based implementation of the A* algorithm.  Although you cannot control one of the tanks yet, you can toggle on options to visualize how each tank is using the A* algorithm for pathfinding.

I was struggling with a memory leak in Mars until a member of the Dallas Rust Meetup mentioned that the wee_alloc dependency that I was using for memory allocation with WebAssembly (Wasm) was known to have this issue.  I removed wee_alloc and the problem immediately disappeared.  I have since updated my Rust-webpack Project Setup tutorial to no longer include wee_alloc in the setup instructions.


Monday, June 12, 2023

Beginning Rust

Tonight I finished reading Beginning Rust: Get Started with Rust 2021 Edition (2e) by Carlo Milanesi.  I found some detailed explanations for difficult concepts in this book that I had not come across elsewhere including The Rust Book.  I also appreciated that the book teaches the formal terminology for the various language features.

I started reading "Beginning Rust" in parallel with another Rust book for beginners by a different author.  Whereas the other book teaches Rust to the reader by guiding them through example applications, this book focuses strictly on the language as demonstrated with code snippets.  I think the latter approach permitted the author of "Beginning Rust" to do a better job of putting the topics in prerequisite order.

Before "Beginning Rust", I also finished reading Rust for Rustaceans but I will have to read that one again in a year or two before I can review it properly as it was too advanced for me.  I think "Beginning Rust" is a better immediate follow-on to "The Rust Book".  I might look at Rust Atomics and Locks by Mara Bos next.

Saturday, January 14, 2023

Rust Life

I implemented Conway's Game of Life in the Rust programming language and compiled it to WebAssembly (Wasm) so that it runs in a webpage.  I initialized the project directory using the steps from Rust-webpack Project Setup checklist and re-used code from my animated interactive Evolve simulation.


Monday, January 02, 2023

Rust-webpack Project Setup

As part of capturing my lessons learned from converting CroftSoft Evolve from a Java applet to a Rust-WebAssembly application, I started writing a Rust-webpack Project Setup tutorial checklist.  There is enough there now to get the "Hello, World!" example code running that I created for my now obsolete rust-webpack-template tutorial.


Wednesday, December 21, 2022

Rust Evolve

Two decades ago, I wrote the book Advanced Java Game Programming which taught readers how to make animated 2D games that would run in a webpage.  Now I am learning how to do that using Rust and WebAssembly.  Evolve is an animated interactive evolutionary algorithm simulation that you can play with that I recently converted from Java to Rust.  The code is available from my open source repository.


Thursday, November 24, 2022

Using the rust-webpack-template

Using the rust-webpack-template is a checklist that I made for setting up projects that use Rust and WebAssembly instead of JavaScript to dynamically create webpage content.  Since rust-webpack-template has not been updated for a few years, the checklist includes steps for dealing with outdated dependencies.  It also includes starter code and an extensive list of related links.


Monday, October 03, 2022

Into ZAMs

Previously I wrote about using Zero Arguments Methods (ZAMs) as a work-around for the Rust programming language not yet supporting named arguments.  Here I show how an Into trait implementation can be used as a ZAM.  I start from a conventional unnamed arguments function that I gradually convert into an Into ZAM.

Start with an output structure for your calculation:

pub struct RotationMatrix {
  pub rows: [[f64; 3]; 3],
}

Make an associated function that takes in a number of unnamed arguments, performs the calculations, and then returns the result as the output structure.

let rotation_matrix: RotationMatrix
  = RotationMatrix::from_degrees(-45.0, 90.0, 135.0);

Next, to support named arguments, modify your associated function to accept an input structure as the sole argument:

pub struct RotationDegrees {
  pub x: f64,
  pub y: f64,
  pub z: f64,
}

let rotation_matrix: RotationMatrix
  = RotationMatrix::from_degrees(
    RotationDegrees {
      x: -45.0,
      y: 90.0,
      z: 135.0,
    });

To make a ZAM, you could move the calculation code from an associated function on the output structure to a method on the input structure:

let rotation_degrees = RotationDegrees {
  x: -45.0,
  y: 90.0,
  z: 135.0,
};

let rotation_matrix: RotationMatrix
  = rotation_degrees.to_rotation_matrix();

Instead, however, move the calculation code to a From trait implementation:

impl From<RotationDegrees> for RotationMatrix {
  fn from(rotation_degrees: RotationDegrees) -> Self {
    // [...]
  }
}

let rotation_matrix: RotationMatrix
  = RotationMatrix::from(rotation_degrees);

Implementing the From trait automatically implements the Into trait which now serves as your ZAM:

let rotation_matrix: RotationMatrix
  = rotation_degrees.into();

Saturday, September 17, 2022

Rust Podcast List

Previously I wrote about how I have been enjoying listening to Rust programming language podcasts.  Since then, I have discovered three more Rust podcasts for a total of six.  Today I updated my list of all Rust podcasts on the CroftSoft Links webpage.

Saturday, August 13, 2022

Sycamore Prototype

Today I launched a new open source project, the CroftSoft Sycamore Prototype.  This is a conversion of one of my old Angular-based CSS Grid Layout demonstrations to the Rust-based front-end framework Sycamore.  My portfolio page has a link to a demonstration of the in-progress prototype.

Previously I was focusing on the far more popular Yew framework but according to this comparisons webpage on the Perseus website, Yew does not support static site generation (SSG) and server side rendering (SSR).  Perseus appears to be a framework layered on top of Sycamore which does support SSG and SSR.  Besides Sycamore / Perseus, another framework that I am considering is Dioxus.