Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Latest commit

 

History

History
64 lines (40 loc) · 2.19 KB

Rust.org

File metadata and controls

64 lines (40 loc) · 2.19 KB

Rust

Introduction

Rust seems to be a good system language: not too abstract, but with enough sugar; no runtime gc; plus its memory management using ownership (and lifetimes) is fun.

Rust has an official online book, which oftentimes is very helpful. But I don’t know if it’s me not being a careful reader, but sometimes the book seems a little bit verbose, yet confusing. For example, I think a table comparing the different types of references would serve well as an intro or a summary to the ownership chapters.

Ownership

There’s a good article on Medium that clarify things a bit after reading the Rust book.

Reference

ReferenceMutable Reference
syntaxsrc_rust{&x}src_rust{&mut x}
move semanticscopymove

References don’t have to be explicitly dereferenced; there are auto-dereferencing rules. (some say impl for both types and reference types?)

Zero-cost Abstractions

Abstraction without overhead: traits in Rust https://blog.rust-lang.org/2015/05/11/traits.html

https://ruudvanasseldonk.com/2016/11/30/zero-cost-abstractions

Zero-cost futures in Rust https://aturon.github.io/blog/2016/08/11/futures/

Bare metal

Writing an OS in Rust (Second Edition) https://os.phil-opp.com/freestanding-rust-binary/

Unsafe rust

https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code

Optimization

https://github.com/mbrubeck/fast-rust/blob/master/src/021-cargo-profile.md https://gist.github.com/jFransham/369a86eff00e5f280ed25121454acec1#use-link-time-optimization

LTO

https://doc.rust-lang.org/rustc/linker-plugin-lto.html

Book on Kernel

https://os.phil-opp.com/minimal-rust-kernel/

Embedded Rust

https://docs.rust-embedded.org/embedonomicon/preface.html