Tutorial: Rust

Luis Miguel Pinho and Tiago Carvalho, ISEP, Portugal

The tutorial is a full-day event that consists of two parts.

Tutorial T3 - Rust Fundamentals

This part of the tutorial will provide attendees with the basics of programming in the small in Rust, covering data types, control-flow constructs, statements, expressions and functions, as well as some aspects of object- oriented programming and generics. This part will then focus on the (somehow) complex mechanisms of Rust for mutability and ownership of variables, showing how Rust tracks the lifetime and scope of all references in a program during compilation, enforcing memory safety and preventing concurrent data races, providing flexibility without requiring the use of a garbage collector. This part of the tutorial will also present two of the most relevant concepts used for functional style of programming in Rust: closures and iterators, showing how these concepts can be used together to implement programs in a declarative style.

Duration: half-day

Level: Intermediate

Attendees should be familiar with programming languages in general.

Reason for attending

  • Understand the main concepts behind the Rust programming language
  • Learn how Rust addresses memory safety and programming in the small
  • Learn the most relevant concepts used for functional style of programming in Rust

Tutorial T4 - Concurrency and Parallelism in Rust

This part of the tutorial will provide attendees with some of the available mechanisms and libraries of Rust to program concurrent and parallel applications. This part will start with the basic concurrency mechanisms provided in the Rust language and its standard library: threads, channels, shared data support with the Atomically Reference Counted type, and thread synchronization. The Rust language provides by itself a limited set of mechanisms for concurrency, giving preference to the implementation of more advanced mechanisms through libraries. Therefore, this part of the tutorial will briefly present some of the common libraries for concurrency (such as parking_lot or crossbeam), focusing afterwards in more advanced libraries for concurrent and parallel applications: the Threadpool library, which provides a simple thread pool approach to execute lightweight tasks and Rayon, a data-parallelism library that makes it easy to convert sequential computations into parallel by using iterators.

Duration: half-day

Level: Advanced

Attendees should be familiar with the Rust programming language (possibly by attending the first part of the tutorial).

Reason for attending

  • Learn the main features provided by the Rust language to support safe concurrency
  • Learn some of the main libraries available for concurrent and parallel programming in Rust

Presenters

Luis Miguel Pinho is a Professor at the Department of Computer Engineering - School of Engineering of the Polytechnic Institute of Porto, and Senior Researcher at the INESC TEC Associated Laboratory. He promotes and leads activities in, among others, real-time parallel programming models, reliable software, and edge computing. He has published more than 150 papers in international conferences and journals in the area of real-time embedded systems, and has been general/program chair of several international conferences. He is a member of ISO/IEC JTC1/SC22/WG9, and senior member of ACM and IEEE. He was Editor-in-Chief of the Ada User Journal, and is currently Technical Editor of ACM SIGAda Ada Letters.

Tiago Carvalho is a researcher and invited professor at the School of Engineering of the Polytechnic Institute of Porto, where he works in activities related to real-time parallel programming and timing analysis. He has a PhD in Compilers and a MSc degree in Computer Engineering from the Faculty of Engineering of the University of Porto (FEUP), where he is an invited assistant professor. Tiago has experience in compiler-related topics such as domain-specific languages and compiler optimizations.