Rust 101 – 20: Unit, integration and benchmark tests

How to write unit tests in your Rust code, and some quick pointers on writing integration and benchmark tests.

Series: 1: Intro, 2: Language basics, 3: Memory and ownership, 4: Exercises A1, 5: References, 6: Structs and Enums, 7: Panic and Result, 8: Methods, 9: Vec and Box, 10: Strings, 11: Exercises A2, 12: Traits, 13: Type Params, 14: std Traits, 15: Lifetimes, 16: Exercises A3pt1, 17: Exercises A3pt2, 18: Dependencies, 19: API design, 20: Tests

Links:

The course materials for this series are developed by tweede golf. You can find more information at github.com/tweedegolf/101-rs and you can sponsor the work at 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.

Standing for the Matrix Governing Board

I have decided to stand for election to the Matrix Governing Board, which is a brand new body which advises and oversees the work of the Matrix Foundation. I will stand as an Individual Member, not representing a company or project.

Contents:

Purpose of the board

The board will operate on an advisory basis, but it will be responsible for approving budgets, projects and partnerships that are significant to the future of the foundation.

I see the Governing Board as having two major purposes:

  1. Speaking up if the foundation starts down the wrong course. Hopefully it won’t happen, but if the foundation makes choices that are harmful to Matrix or the community, the board can shout about it (but not actually block it).
  2. Guiding direction for the best interests of the community. The board will consist of people with personal and professional interest in the success of Matrix, and with expertise in many areas, so I hope and expect it will provide advice and guidance that help the foundation channel its funding and effort towards that success.

My qualifications and interests

  • I am a long-standing contributor to many Free/Open Source projects. My contribution history dates back to at least 2001 and I have been an enthusiastic supporter of the principles of Software Freedom for many years.
  • I am a sustainer of the Software Freedom Conservancy as well as a Matrix Foundation individual member.
  • As part of my work for Element I have contributed across many Matrix projects including MSCs and the spec, the JS SDK and React SDK, the Rust SDK, the Crypto tests and the rich text editor, along with many others.
  • I am a good communicator, and have made many popular programming videos (released under Free Culture licenses).
  • I am known in the places I have worked as a highly collaborative team member, bringing organisational abilities and people skills along with my technical expertise.

You can find out more about me at artificialworlds.net.

My biases

I am an employee of Element, meaning it is in my interest for Element to prosper. Since one of the purposes of the Governing Board is to increase the independence of the Matrix Foundation from Element, this could be a downside to my involvement.

I have a long work and free software history outside Element which I think will help me balance the different interests, and I commit to remove myself from decisions whenever I think that my employment situation might cause a conflict of interest. This means if I think on a particular topic Element’s interests might be in conflict with the foundation’s I will remove myself from the decision-making on that topic and make a short statement explaining why.

In practice, I believe that Element is a critical supporter of Matrix, and the purpose of its founding was to make Matrix successful, so I expect that in most cases there will be no conflict. (It’s worth noting that if you disagree with that, you should probably vote against me!)

My other biases are towards Software Freedom and open standards. I like Copyleft licenses, I prefer to avoid the use of non-free platforms (e.g. GitHub) and I am normally against strong CLAs.

I am an enthusiastic supporter of Matrix because I can imagine a world where everyone can communicate securely and privately with their friends and family, companies, medical services, governments and anyone else, free of snooping and manipulation by powerful individual companies. In this world, we can talk privately, do business, and administrate our lives without worrying about who is excluded, who is listening, and whether we are the product. It’s a little miracle that so many people have access to email, and it’s time to level up to real-time, secure communication that is free from unwanted control and influence.

My priorities

  • I want Matrix to last. When I look at the success of the Linux project, I see years of steady work paying off in the long term. The project put its attention into making an excellent piece of software, and “taking over the world” came slowly and naturally as a by-product of that. I think Matrix should take the same approach: steadily working on creating an excellent open standard and excellent implementations of it. Taking over the world (which is absolutely my ambition!) will inevitably come if the product is good enough, because the advantages of openness are so strong.
  • For Matrix to last, the foundation needs financial independence. I want to see the foundation raise more money, both from individuals and from corporate and government users. I’d like to see the foundation itself fund development of the standard and some implementations. This would help development focus on the features that are of most benefit to the whole community, and, critically, it would support the “boring” work of maintenance and high quality.

If you like the idea of my voice helping to guide the Matrix Foundation, please vote for me!

Rust 101 – 19: Creating a nice API

Tips and rules for writing good APIs that are easy for other people to use. Try to make them Unsurprising, Flexible, and Obvious.

Series: 1: Intro, 2: Language basics, 3: Memory and ownership, 4: Exercises A1, 5: References, 6: Structs and Enums, 7: Panic and Result, 8: Methods, 9: Vec and Box, 10: Strings, 11: Exercises A2, 12: Traits, 13: Type Params, 14: std Traits, 15: Lifetimes, 16: Exercises A3pt1, 17: Exercises A3pt2, 18: Dependencies, 19: API design, 20: Tests

Links:

The course materials for this series are developed by tweede golf. You can find more information at github.com/tweedegolf/101-rs and you can sponsor the work at 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.

Rust 101 – 18: Dependencies and Cargo.toml

How to describe details of your Rust project with a Cargo.toml file, and how to find and add dependencies (other people’s code).

Series: 1: Intro, 2: Language basics, 3: Memory and ownership, 4: Exercises A1, 5: References, 6: Structs and Enums, 7: Panic and Result, 8: Methods, 9: Vec and Box, 10: Strings, 11: Exercises A2, 12: Traits, 13: Type Params, 14: std Traits, 15: Lifetimes, 16: Exercises A3pt1, 17: Exercises A3pt2, 18: Dependencies, 19: API design, 20: Tests

Links:

The course materials for this series are developed by tweede golf. You can find more information at github.com/tweedegolf/101-rs and you can sponsor the work at 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.

Rust 101 – 17: Exercises for module A3 (part 2)

Finishing off the exercises on Rust traits, designing a customised version of Vec.

Series: 1: Intro, 2: Language basics, 3: Memory and ownership, 4: Exercises A1, 5: References, 6: Structs and Enums, 7: Panic and Result, 8: Methods, 9: Vec and Box, 10: Strings, 11: Exercises A2, 12: Traits, 13: Type Params, 14: std Traits, 15: Lifetimes, 16: Exercises A3pt1, 17: Exercises A3pt2, 18: Dependencies, 19: API design, 20: Tests

Links:

The course materials for this series are developed by tweede golf. You can find more information at github.com/tweedegolf/101-rs and you can sponsor the work at 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.