YoVDO

Taking Constant Evaluation to the Limit - RustConf 2019

Offered By: Rust via YouTube

Tags

Rust Courses Microcontroller Programming Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the intricacies of constant evaluation in Rust with this RustConf 2019 talk by Oliver Schneider. Delve into the new theoretically unrestricted constant evaluator in rustc, nicknamed Miri (MIR interpreter), and discover its potential for complex static initializations, microcontroller programming, and runtime code reduction. Learn about the grading of constant evaluators, necessary and unnecessary restrictions, and the challenges of heap allocations. Examine practical examples, including String implementations and unsafe operations in constants, while understanding the stricter rules applied at compile-time. Gain insights into compile-time undefined behavior, const assertions on stable Rust, and even witness a Fibonacci sequence calculated at compile-time. Perfect for Rust developers seeking to push the boundaries of constant evaluation and optimize their code.

Syllabus

Intro
Why const eval?
Grading constant evaluators
Why restrict ourselves?
What restrictions do we want?
What unnecessary restrictions do we have?
Open RFC
Details, details, details ...
Heap allocations...
Heap problems
Example with String
impl Send for &Sync
Unsafe in constants
compile time undefined behavior
Not UB
Much stricter rules at compile-time
Less stricter rules at compile-time
Summary
Don't try this at home
Const assertions on stable rust
Fibonacci at compile-time
Spot the fib


Taught by

Rust

Related Courses

Embedded Systems - Shape The World: Microcontroller Input/Output
The University of Texas at Austin via edX
Programming for the Internet of Things Project
University of California, Irvine via Coursera
Embedded Systems - Shape The World: Multi-Threaded Interfacing
The University of Texas at Austin via edX
Wie programmiere ich meinen ersten Mini-Computer?
openHPI
A Subjective Introduction to the IoT
ITMO University via edX