Rust
- Learning
- The language & its features
- Error Handling
- Testing
- Coverage
- Development Tools
- Debugging
- Observability
- Performance Engineering
- Command Line Applications
- Configuration Management
- Interop
- Algorithms
- Entity Component Systems
- Games
- Graphics
- User Interfaces
- Storage & Data Bases
- Text Search
- Operating Systems
- Cloud
- Embedded
- Cross Compiling
- Programming Language Technology
- Notes
Learning
- This Week In Rust
- Read Rust
- A half-hour to learn Rust
- The Rust Programming Language Book
- Comprehensive Rust
- Rust by Example
- The Rust Cookbook
- Into Rust
- Rust-101
- Rust 101, tutorial de Rust en español
- Learn Rust: A Resource Guide
- Ferrous Systems' Elements of Rust
- play.org Rust
- 2020 Rust Starter Kit
- Learn Rust With Entirely Too Many Linked Lists
- JavaPoint Rust Tutorial
- How to Get Started With Rust
- Easy Rust
- Tour of Rust
- Rustlings
- 2021/06 The Rustlings exercises - part 1
- Exercism
- Learning Rust
- Ferrous Systems: Learning Rust
- Ferrous Systems: Learning Rust: Mindsets and Expectations
- Ferrous Systems: Learning Rust: OMG WTF RS – resources to help you get started with Rust
- Learn Rust With Benford's Law
- Easy Rust
- PingCap
- Awesome Rust
- rust-learning
- cheats.rs
- ralfbiedert/cheats.rs
- Rust Quizhttps://github.com/dtolnay/rust-quiz
- Can I use...
- ferrous-systems / teaching-material
- Rust from 0 to 80% for JavaScript Developers
- Rust by Practice
- Effective Rust - 35 Specific Ways to Improve Your Rust Code
The language & its features
- 2013/05/01 Go and Rust — objects without class
- 2013/07/03 Philosophy and "for" loops — more from Go and Rust
- 2014/12/21 Rust, an Anti-Sloppy Programming Language
- 2015/09/28 When Rust Makes Sense, or The State of Typed Languages
- 2016/09/01 IRLO: Setting our vision for the 2017 cycle
- 2016/10/07 Type-Safe Unions in C++ and Rust
- 2016/12/21 Four years with Rust
- 2017/12/21 Rust in 2017: what we achieved
- 2018/01/03 My journey with Rust in 2017 — The good, the bad, the weird
- 2018/01/13 Rust in 2018: it's way easier to use!
- 2018/07/27 What is Rust 2018?
- 2018/12/06 Rust 2018 is here… but what is it?
- 2018/12/08 The Fallow Year, my Rust2019 post
- 2018/12/28 Thoughts on Rust in 2019
- 2019/01/01 Rust in 2019
- 2019/01/04 r/rust Rust 2019: Beat C++
- 2019/01/07 Rust in 2019: Focus on sustainability
- 2019/01/12 Rust 2019: Solid Foundations for Unsafe Code
- 2020-10-05 The Rust 2021 Experience - Year of the Macro
- 2020/09/03 Planning the 2021 Roadmap
- 2020/09/05 Joshua Nelson: Rust in 2021
- 2020/09/08 mark-i-m: Rust 2021
- 2020/09/08 Nick Cameron: Rust in 2021
- 2020/09/10 Ivan Tham: Rust 2021
- 2020/09/12 Aleksey Kladov: Rust in 2021 r/rust
- 2020/09/13 Henri Sivonen: Rust 2021
- 2020/09/17 Krishna Sundarram: Rust 2021: Lower the barriers
- 2020/09/21 Llogiq: Rust 2021 – Ethical Development
- 2020/09/28 Raph Levien: Rust 2021: GUI r/rust HN
- 2020/10/05 Rust 2021: Foundation
- 2021/10/15 xampprocky: Rust 2021: Sustainability
Rust vs Other Languages
- 2013 Benchmarks Round Two: Parallel Go, Rust, D, Scala and Nimrod
- 2015 Why Go and Rust are not competitors
- 2015 A Quick Comparison of Nim vs. Rust
- 2016 Rust vs C Pitfalls
- 2017 Rust vs. Go
- 2018 Should C Programmers learn C++, Go or Rust?
- 2018 The success of Go heralds that of Rust
- 2019 One Program Written in Python, Go, and Rust
- 2019 Why Go and not Rust?
- 2020 Rust & Python — A Gentle Comparison using Simple Neural Networks
- 2020 Rust vs Go
- 2020 Early Impressions of Rust from a Go Programmer
- 2020 Go vs Rust: Writing a CLI tool
- 2020 Go vs Rust: Which is Better Programming Language for Future and Why?
- 2020 Why Discord is switching from Go to Rust
- 2020 Pros and Cons of Rust and Go
- 2020 Assorted thoughts on zig (and rust)
Ownership
- 2014 Rust Means Never Having to Close a Socket
- 2014 How to think about Rust ownership versus C++ unique_ptr
- 2014 Rust lifetimes: Getting away with things that would be reckless in C++
- 2015 Rust – memory safety without garbage collector
- 2015 Rust, Ownership, and Iteration
- 2015 Understanding Pointers, Ownership, and Lifetimes in Rust
- 2015 Rust Data Ownership
- 2016 Rust's ownership and borrowing in 150 words
- 2016 Understanding Rust: ownership, borrowing, lifetimes
- 2016 Why Rust's ownership/borrowing is hard
- 2016 Rust's Ownership Model
- 2016 Moving, Cloning, and Copying Coloring Books in Rust
- 2016 into_rust() Why Rust?
- 2016 into_rust(Hello, world!)
- 2016 into_rust() Ownership
- 2016 into_rust() Shared borrows
- 2016 into_rust() Mutable borrows
- 2016 Learn You a Rust for Great Good!
- 2016 Learn You a Rust II - References and Borrowing
- 2016 Learn You a Rust III - Lifetimes 101
- 2016 Learn You a Rust IV - Lifetime Fenangling
- 2016 Tricks with ownership in Rust
- 2017/01/22 Short intro to C++ for Rust developers: Ownership and Borrowing
- 2017 Graphical depiction of ownership and borrowing in Rust
- 2017 Ownership and Borrowingand Lifetimes (Oh My!)
- 2017 What's a reference in Rust?
- 2017 Strategies for Returning References in Rust
- 2017 Racking Your Brain with Rust
- 2018 Ownership in Rust, Part 1
- 2018 Ownership in Rust, Part 2
- 2018 Ownership Explained with Python
- 2018 Ownership in the Rust Language
- 2018 Basics of Ownership: Rust Crash Course Lesson 2, Part 1
- 2018 Fear not the Rust Borrow Checker
- 2018 Rust Design Considerations with Borrowing
- 2018 Ownership & Borrowing
- 2018 Move Semantics vs Copy Semantics
- 2018 MIR-based borrow check (NLL) status update
- 2018 The Concept of Ownership in Rust andSwift
- 2018 Moves and Borrowing In Rust With Jim Blandy
- 2018 Rust Lifetimes for the Uninitialised
- 2018 How to Use Rust Non Lexical Lifetimes on Nightly
- 2019 Understanding Rust Lifetimes
- 2019 Memory Management in Rust: Ownership
- 2019 Rust ownership, the hard way
- 2019 Rust: The Hard Parts - Part One
- 2019 Here be (owned) books
- 2019 Breaking News: Non-Lexical Lifetimes Arrives for Everyone
- 2019 The Power of Lifetimes
- 2020 The Fatal Flaw of Ownership Semantics
- 2021 Understanding ownership in Rust
- 2022/04 The Rust Borrow Checker - a Deep Dive
- 2022/08 Borrow is not a pointer
Concurrency
- 2015 Fearless Concurrency with Rust
- 2017 Multithreading in Rust with MPSC (Multi-Producer, Single Consumer) channels
- 2017 Implementing cooperative multitasking in Rust
- 2017 on mutex performance and WTF::Lock
- 2018 A Rusty Go at Channels
- 2019 Rust parallelism for non-C/C++ developers
- 2019 Rust concurrency patterns: regretless concurrency?
- 2019 Lock-free Rust: Crossbeam in 2019
- 2020 Concurrency Patterns in Embedded Rust
- 2022 Rust Concurrency Cheat Sheet
- 2022/05 Arc and Mutex in Rust
Async/Await
- Asynchronous Programming in Rust
- Are We Async Yet?
- RFC 2394 async/wait
- 2016 Zero-cost futures in Rust · Aaron Turon
- 2018 Async Methods I: generic associated types
- 2018 Async Methods II: object safety
- 2018 Async/Await I: Self-Referential Structs
- 2018 Async/Await II: Narrowing the Scope of the Problem
- 2018 Async/Await III: Moving Forward with Something Shippable
- 2018 Async/Await IV: An Even Better Proposal
- 2018 Async/Await V: Getting back to the futures
- 2018 Async/Await VI: 6 weeks of great progress
- 2018 Async & Await in Rust: a full proposal
- 2019 Asynchronous Destructors
- 2019 Async-await status report
- 2019 Async-await status report #2
- 2019 why async fn in traits are hard
- 2019 Announcing the Async Interviews
- Async Interview #1: Alex and Nick talk about async I/O and WebAssembly
- Async Interview #2: cramertj
- Async Interview #2: cramertj, part 2
- Async Interview #2: cramertj, part 3
- Async Interview #3: Carl Lerche
- Async Interview #4: Florian Gilcher
- Async Interview #5: Steven Fackler
- Async Interview #6: Eliza Weisman
- Async Interview #7: Withoutboats
- Async Interview #8: Stjepan Glavina
- Async interviews: my take thus far
- 2018 Inside Rust's Async Transform
- 2018 Hexilee/async-io-demo
- 2019 How Rust optimizes async/await I
- 2019 How Rust optimizes async/await II
- 2020 async/await on embedded Rust
- 2019 Explained: How does async work in Rust?
- 2019 Explained: Futures in Rust for Web Development
- 2019 Reddit: Is await only useful is my code doesn't do much itself?
- 2019 Async Stack Traces in Rust
- 2019 Stop worrying about blocking: the new async-std runtime, inspired by Go
- 2019 Streams Concurrency
- 2019 Async-await on stable Rust!
- 2019 Announcing Rust 1.39.0
- 2020 A practical guide to async in Rust
- 2020 I'm not feeling the async pressure
- 2020 Surviving Rust async interfaces
- 2020 Futures Explained in 200 Lines of Rust
- 2022/03 Async destructors, async genericity and completion futures
- 2022/06 (async) Rust doesn't have to be hard
- 2022/06 Local Async Executors and Why They Should be the Default
Tokio
- Tokio.rs
- Tokio Tutorial
- Tokio Blog
- 2018 What Are Tokio and Async IO All About?
- 2019 tokio ain’t for mere mortals
- 2019 Using TLS in RustGetting async I/O with tokio, second try
Unsafe
- Rust's Unsafe Code Guidelines Reference
- The Rustonomicon
- unsaferust.org
- 2016 The Scope of Unsafe
- 2017 Undefined vs Unsafe in Rust
- 2018 Unsafe Abstractions
- 2018 You can't "turn off the borrow checker" in Rust
- 2021 An unsafe tour of Rust's Send and Sync
Macros
- A Practical Intro to Macros in Rust 1.0
- The Little Book of Rust Macros
- cargo-expand
- 2016 Things you could do with the Rust AST
- 2017 An Overview of Macros in Rust
- 2017 My first Rust macro
- 2017 Abstracting over mutability in Rust macros
- 2018 Rust Blog: Procedural Macros in Rust 2018
- 2018 Why Rust Has Macros
- 2018 The Case For Macros
- 2018 Program Synthesis is Possible in Rust
- 2018/12 IRLO Procedural Macros book
- 2019 A Love Letter to Rust Macros
- 2019 Deriving Traits in Rust with Procedural Macros
- 2019 6 useful Rust macros that you might not have seen before
- 2019 Reddit: Rust macros are amazing. I recently ran into a profound limitation of C++ at my job trying to apply an operation to a collection of identifiers
Error Handling
- anyhow This library provides anyhow::Error, a trait object based error type for easy idiomatic error handling in Rust applications.
- eyre This library provides eyre::Report, a trait object based error handling type for easy idiomatic error handling and reporting in Rust applications. This crate is a fork of anyhow with a support for customized error reports. For more details on customization checkout the docs on eyre::EyreHandler.
- simple-eyre This library provides a custom eyre::EyreHandler type for usage with eyre that provides a minimal error report with no additional context. Essentially the minimal implementation of an error reporter.
- stable-eyre This library provides a custom eyre::EyreHandler type for usage with eyre that provides all the same features as eyre::DefaultHandler except it works on stable by capturing a backtrace::Backtrace via backtrace-rs.
- thiserror This library provides a convenient derive macro for the standard library's std::error::Error trait.
- adhocerr A library for the construction of efficient single use static/dynamic error types per callsite.
- extracterr Helpers for bundling context with errors and later extracting said context thru dyn Error trait objects. The primary purpose of this crate is to pass context to error reporters through dyn Error trait objects. This is useful for information that may need to be captured by leaf errors but which doesn't belong in any single error's message. Backtraces, http status codes, and help messages are all examples of context that one might wish to pass directly to an error reporter rather than printing in the chain of errors.
- quick-error A macro which makes error types pleasant to write.
- failure deprecated
- Rust traits for iterator of Option and Result
- The Rust Programming Language Book: Chapter 9 Error Handling
- Rust Cookbook - Error Handling
- Rust By Example - Error handling
- Microsoft Training - Take your first steps in Rust - Handle errors in Rust
- Ferrous Systems Teaching Material - Error Handling
- Effective Rust Item 3: Avoid matching Option and Result
- Effective Rust Item 4: Prefer idiomatic Error variants
- Result and Option map
- 2014/10/16 On Error Handling in Rust
- 2014/11/06 Improved Error Handling in Rust
- 2015/05/14 Error Handling in Rust — Andrew Gallant's Blog
- 2016/01/28 Rust: The
?
operator · m4rw3r - 2016/11/30 Starting a new Rust project right, with error-chain
- 2018/04/20 Why Rust's error handling is awesome
- 2018/12/06 RUST : ERROR HANDLING
- 2019/11/13 Error Handling Survey
- 2019/11/14 Thoughts on Error Handling in Rust
- 2020/04/05 My private take on error handling in Rust
- 2020/04/08 Error Handling in a Correctness-Critical Rust Project r/
- 2020/04/16 Unwrap and Expect in Rust
- 2020/05/06 Rust Error Handling
- 2020/05/13 Rust: Structuring and handling errors in 2020 r/
- 2020/06/05 Taking the Unhappy Path with Result, Option, unwrap and ? operator in Rust
- 2020/06/15 Understanding Memory and Thread Safety Practices and Issues in Real-World Rust Programs r/ r/
- 2020/08/02 Beginner's guide to Error Handling in Rust
- 2020/08/16 Rust Error Handling | How to Define Generic Error Types?
- 2020/09/08 As a hobbyist rust developer, I want to think less about error handling
- 2020/09/18 Announcing the Error Handling Project Group
- 2020/09/18 Announcing the Error Handling Project Group
- 2020/10/18 Building Your Own Error Type: Part 1
- 2020/11/18 Anonymous Sum Types for Rust Error Handling
- 2020/11/23 What the Error Handling Project Group is Working On
- 2020/11/30 Error handling is hard
- 2021/01/24 Wrapping Errors in Rust
- 2021/04/04 Unwrapping Options and Results: Part 1
- 2021/04/06 A Beginner's Guide to Handling Errors in Rust
- 2021/05/13 Error Handling In Rust - A Deep Dive
- 2021/07/01 What the Error Handling Project Group is Working Towards
- 2021/07/18 Geeks for Geeks - Rust Error Handling
- 2021/09/07 Error handling in Rust
- 2021/12/13 Rust Error Handling
- 2022/01/16 Outcomes, Mistakes, and the Nuance of Error Handling HN
- 2022/01/16 Rust Error Handling, Part One
- 2022/01/17 Rust Error Handling, Part Two
- 2022/01/31 Rust Linz, January '22 - Error Handling in Rust - A Pragmatic Approach by Luca Palmieri
- 2022/02/08 The simplest guide to error handling in Rust
- 2022/03/27 Handling Errors in Rust
- 2022/04/01 Understanding Rust Option and Result enums
- 2022/04/06 Rusty shorts -(Option, Result)
- 2022/05/06 Beginner-Intermediate Rust Error Handling r/
- 2022/05/23 Crash reporting in Rust
- 2022/06/30 More than you've ever wanted to know about errors in Rust r/
- 2022/07/01 Simple error handling in Rust r/rust
- 2022/07/14 Why Rust should not have provided unwrap r/
- 2022/08/08 Using unwrap() in Rust is Okay
- 2022/09/14 Rust Error Handling
- 2023/04/08 Modular Errors in Rust r/
- 2018/12/27 r/rust ELI5 error handling / error-chain / failure / upcoming std Error improvements
- 2019/02/03 r/rust My approach to Error Handling and Pattern Matching feels a bit extreme - how can I improve my code?
- 2020/08/01 r/rust How does new error handling work?
- 2020/10/19 r/rust Java's error handling system is better than that of Rust
- 2021/09/26 r/rust Poor (and bizarre) rustc error message?
- 2022/06/14 r/rust Syntactic Ruminations: Option
::map or Result<T, E>::and_then, but for T
Testing
rstest
Mcat12/shaku
dtolnay/trybuild
- Rust by Example: Testing
- Rust Design-for-Testability: a survey
- 2016/04 Why does Rust test framework lack fixtures and mocking?
- 2016/07 Test setup and teardown in Rust without a framework
- 2016/12 r/ Testing frameworks?
- 2018/07 #[test] in 2018
- 2018/04 Writing an OS in Rust : Unit Testing
- 2019/04 Writing an OS in Rust : Testing
- 2020/01 Smoke-testing Rust HTTP clients
- 2020/03 r/ Announcing Kaos, chaotic testing harness for Rust (Resilience Testing)
- 2020/05 How to organize your Rust tests
- 2022/07 Unit and integration tests
- Adventurous Computing
Fuzzing
Coverage
- 2015/03 URLO Tutorial: How to collect test coverages for Rust project
- 2016/04 Rust Code Coveragef Tools
- 2020/11 Rust Blog: Source-based code coverage in nightly
- 2020/11 How to collect Rust source-based code coverage
- 2022/04 Measuring the coverage of a rust program in Github Actions
Development Tools
Editors
VS Code
Xi
Helix
- helix-editor/helix A post-modern modal text editor.
Lapce
Zed
Cargo
Rust Analyzer
- Rust Analyzer
- Manual
- Blog
- rust-analyzer/tree/master/docs/dev
- Changelog
- Github
- Guide
- Rust Analyzer in 2018 and 2019
- Status of rust-analyzer: Achievements and Open Collective
- Rust Analyzer Q&A
- 2020 Intro to Rust Analyzer
- 2020 What I learned contributing to Rust-Analyzer
- 2021 Architecture
- 2021 Matklad: Architecture
- 2022/06 Unsafe code highlighting with rust-analyzer
Debugging
GDB
- Beej's Quick Guide to GDB
- Stanford CS107 GDB and Debugging
- Harvard CS1612 What GDB is and why you need to use it
- GDB Cheatsheet
- Debugging with GDB - Supported Languages: Rust
- Writing an OS in Rust - Set Up GDB
- 2014/01 Debugging Rust with gdb
- 2015/03 rust-gdb. rust-lldb.
- 2020/09 How to debug Rust via GDB
- 2021/02 Debugging Rust apps with GDB
- 2021/05
LLDB
- 2018 Debugging Rust programs with lldb on MacOS
- 2019 Debugging Rust With LLDB
- 2020 A Future for Rust Debugging
- 2020 The Soul of a New Debugger
RR
- RR Project
- 2016 Debugging & Rust
- 2017 Using rust with rr
- 2021 Instant replay: Debugging C and C++ programs with rr
RD
- github.com/sidkshatriya/rd
- 2020 rd: A port of mozilla/rr to Rust programming language
- 2020 rd: Why I chose Rust instead of Golang, OCaml or Dlang for the mozilla/rr debugger port
- 2020 45,000+ lines of Rust code later: An update on the Record & Debug Tool (rd)
Observability
Logging
- Production-Grade Logging in Rust Applications
- Better Logging for the Web Application
- Rust Cookbook: Development Tools: Debugging
- 2020/09 Enabling Diagnostics for Rust Code
- 2020/11 Production-Grade Logging in Rust Applications
- 2021/04 Logging in Rust
Simple minimal loggers
log
A logging facade provides a single logging API that abstracts over the actual logging implementation. Libraries can use the logging API provided by this crate, and the consumer of those libraries can choose the logging implementation that is most suitable for its use case. In order to produce log output, executables have to use a logger implementation compatible with the facade. There are many available implementations to choose from. Executables should choose a logger implementation and initialize it early in the runtime of the program. Logger implementations will typically include a function to do this. Any log messages generated before the logger is initialized will be ignored.env_logger
A simple logger configured via environment variables which writes to stdout or stderr, for use with the logging facade exposed by the log crate.simple_logger
A rust logger that prints all messages with a readable output format. The output format is based on the format used by Supervisord.simplelog
simplelog
does not aim to provide a rich set of features, nor to provide the best logging solution. It aims to be a maintainable, easy to integrate facility for small to medium sized projects, that findenv_logger
to be somewhat lacking in features. In those cases simplelog should provide an easy alternative.pretty_env_logger
A logger configured via an environment variable which writes to standard error with nice colored output for log levels.stderrlog
A simple logger to provide symantics similar to what is expected of most UNIX utilities by logging to stderr and the higher the verbosity the higher the log level. It supports the ability to provide timestamps at different granularities. As well as colorizing the different log levels.flexi_logger
A flexible and easy-to-use logger that writes logs to stderr and/or to files or other output streams. An easy-to-configure and flexible logger that writes logs to stderr and/or to files. It allows custom logline formats, and it allows changing the log specification at runtime. It also allows defining additional log streams, e.g. for alert or security messages.
Complex configurable frameworks
log4rs
log4rs
is a highly configurable logging framework modeled after Java's Logback and log4j libraries.- 2022/03 Advanced logging in rust with log4rs: rotation, retention, patterns, multiple loggers
fern
Efficient, configurable logging in Rust.
slog
slog
Structured, contextual, extensible, composable logging for Rust.slog
is a very complete logging suite for Rust. It is a core followed by many plugins such as term for terminal output, json for JSON output and more.slog
is an ecosystem of reusable components for structured, extensible, composable and contextual logging for Rust. The ambition is to be The Logging Library for Rust.slog
should accommodate a variety of logging features and requirements. If there is a feature that you need and standard log crate is missing,slog
should have it.slog-term
: Unix terminal drain and formatter for slog-rs.slog-json
: Json formatter for slog-rs.slog-atomic
: Atomic run-time controllable drain for slog-rs. Usingslog-atomic
you can create aslog::Drain
that can change behavior in a thread-safe way, in runtime. This is useful eg. for triggering different logging levels from a signal handler.slog-scope
: Logging scopes for slog-rs.slog-scope
allows logging without manually handling Logger objects. Logging scopes are convenience functionality forslog-rs
to free user from manually passing Logger objects around. A set of macros is also provided as an alternative to original slog crate macros, for logging directly to Logger of the current logging scope.slog-async
: Asynchronous drain for slog-rs v2.slog-stdlog
: Standard Rust log crate adapter to slog-rs.slog-extlog
: Add external logs (loggable objects), and for statistics tracking through those logs, for use with the slog ecosystem.slog-syslog
: Syslog drain forslog-rs
.slog-journald
: Journald support forslog-rs
. This is a straightforward journald drain forslog-rs
. Journald andslog-rs
work very well together since both support structured log data. This crate will convert structured data (that is, key-value pairs) into journald fields. Since journald field names are more restrictive than keys in slog-rs, key names are sanitized to be valid journald fields.slog-bunyan
: Based on slog-json, it will output json with bunyan defined fields.slog-envlogger
: Port ofenv_logger
as aslog-rs
drain.env_logger
is a de facto standard Rust logger implementation, which allows controlling logging to stderr via theRUST_LOG
environment variable. This is a fork of env_logger that makes it work as aslog-rs
drain.slog_derive
: Custom derives for use with slog logging.slog-example-lib
: Example of a library using slog-rsslog-kvfilter
: Key values based filter Drain forslog-rs
. Drain filtering records using list of keys and values they must have unless they are of a higher level than filtering applied. It can apply a negative filter as well that overrides any matches but will let higher level than filtering applied as well. This Drain filters a log entry on a filtermap that holds the key name in question and acceptable values Key values are gathered up the whole hierarchy of inherited loggers.slog-perf
: Performance and time reporting forslog-rs
. This crate provides very useful tools for reporting performance metrics through slog.slog-serde
: Serde serialization adapter forslog-rs
.
tracing.rs
- tracing.rs
- 2019 Youtube: RustConf 2019 - Tokio-Trace: Scoped, Structured, Async-Aware Diagnostics by Eliza Weisman
- 2019/08 Diagnostics with Tracing
- 2020/12 r/ Slog vs tracing: Which one do you prefer
- 2021/10 Custom Logging in Rust Using tracing and tracing-subscriber
- 2021/10 Custom Logging in Rust Using tracing and tracing-subscriber, part 2
- 2021/11 Stackoverflow - Rust - Tracing Debugger - Want Simple Explanation Of How To Use
- 2022/05 Comparing logging and tracing in Rust
tracing
:tracing_appender
: Writers for logging events and spanstracing_attributes
: A procedural macro attribute for instrumenting functions withtracing
. This crate provides the#[instrument]
procedural macro attribute.tracing_core
: Core primitives fortracing
.tracing_error
: Utilities for enriching error handling withtracing
diagnostic information.tracing_flame
: A tracing Layer for generating a folded stack trace for generating flamegraphs and flamecharts withinferno
.tracing_futures
: Utilities for instrumentingfutures
withtracing
.tracing_journald
: Support for loggingtracing
events natively tojournald
, preserving structured information.tracing_log
: Adapters for connecting unstructured log records from thelog
crate into thetracing
ecosystem.tracing_macros
:dbg
andtrace_dbg
are similar to thestd::dbg!
macro, but generatetracing
events rather than printing tostdout
.tracing_opentelemetry
: This crate provides a layer that connects spans from multiple systems into a trace and emits them to OpenTelemetry-compatible distributed tracing systems for processing and visualization.tracing_serde
: A compatibility layer for serializing trace data withserde
.tracing_subscriber
: Utilities for implementing and composingtracing
subscribers. This crate contains tools for composing subscribers out of smaller units of behaviour, and batteries-included implementations of common subscriber functionality.tracing-subscriber
is intended for use by bothCollector
authors and application authors using tracing to instrument their applications.tracing_tower
Adaptors for other facilities
syslog
: This crate provides facilities to send log messages via syslog. It supports Unix sockets for local syslog, UDP and TCP for remote servers. Messages can be passed directly without modification, or in RFC 3164 or RFC 5424 format.android_log
:win_dbg_logger
: A logger for use with Windows debuggers. Windows allows applications to output a string directly to debuggers. This is very useful in situations where other forms of logging are not available. For example, stderr is not available for GUI apps.
For WebAssembly binaries
console_log
: A logger that logs to the browser's console. The feature set provided by this crate is intentionally very basic. If you need more flexible formatting of log messages (timestamps, file and line info, etc.) this crate can be used with the fern logger via the console_log::log function. The file and line number information associated with the log messages reports locations from the shims generated by wasm-bindgen, not the location of the logger call.
For embedded systems
defmt
:defmt
("de format", short for "deferred formatting") is a highly efficient logging framework that targets resource-constrained devices, like microcontrollers.
Metrics
NewRelic
New Relic is a company which develops cloud-based software to help website and application owners track the performances of their services.
- newrelic.com
newrelic
: Idiomatic Rust bindings to the New Relic C SDK.newrelic-sdk
: Rust bindings for New Relic.newrelic-sys
FFI bindings for the New Relic C SDK.ackorelic
: An idiomatic Rust wrapper around the New Relic C SDK.tokio-newrelic
:
DataDog
Datadog is a monitoring service for cloud-scale applications, providing monitoring of servers, databases, tools, and services, through a SaaS-based data analytics platform.
Distributed Tracing
OpenTracing
- opentracing.io
- OpenTracing: State-of-the-Art For OpenTelemetry and Open Census
- Understanding OpenTracing, OpenCensus, and OpenMetrics
rustracing
OpenTracing API for Rustopentracingrust
opentracing.io library for rust
OpenTelemetry
OpenTelemetry is an open source observability framework created when the Cloud Native Computing Foundation merged the OpenTracing and OpenCensus projects.
There are a few crates implementing OpenTelemetry-related functionality.
See Tokio tracing's related crate, tracing-opentelemetry
, for example.
opentelemetry
A metrics collection and distributed tracing frameworktracebuild
Command line utility to instrument builds and send traces to OpenTelemetry supported tracing systemsactix-web-opentelemetry
OpenTelemetry integration for Actix Web apps- 2019/05 Announcing OpenTelemetry: the merger of OpenCensus and OpenTracing
- 2019/05 A brief history of OpenTelemetry (So Far)
- 2019/06 OpenTracing vs OpenTelemetry: Building a Bridge with OpenTelemetry
- 2020/11 OpenTelemetry vs OpenTracing: A Guide on Understanding How These Work
- 2021/10 What is OpenTelemetry? An open-source standard for logs, metrics, and traces
Jaeger
- jaegertracing.io
jaeger-opentracing
jaeger for opentracingjaegercat
A handy command line tool showing traces emitted by Jaeger clientsmick-jaeger
Rust client for sending traces to a Jaeger serveropentelemetry-jaeger
Jaeger exporter for OpenTelemetryopentracing-rs-jaeger
jaeger for opentracingrustracing_jaeger
Jaeger client library created on top ofrustracing
.
Zipkin
Honeycomb.io
Performance Engineering
Profiling
flame
inferno
hdrhistogram_rust
pprof-rs
timed
dhat
A library for heap profiling and ad hoc profiling with DHAT.- 2019/04 A better DHAT
- TW
async-benchmark
- lib.rs Profiling
- 2015 Profiling Rust applications on Linux
- 2016 Rust Performance: A story featuring perf and flamegraph on Linux
- 2016 Tools for profiling Rust
- 2017 Rust performance: finishing the job
- 2015 Rust Profiling with Instruments and FlameGraph on OSX: CPU/Time
- 2016 Tools for profiling Rust
- 2016 Rust Performance: A story featuring perf and flamegraph on Linux
- 2017 Rust Profiling with DTrace and FlameGraph on OSX
- 2017 Youtube | RustConf - Improving Rust Performance Through Profiling and Benchmarking by Steve Jenson
- 2017 Profiling Rust code on Windows using CodeXL
- 2017 IRLO: Improve the heap (and cpu) profiling story
- 2018 Profile Rust on Linux
- 2018 URLO: Profiling in rust application
- 2018 Cargo bench, benchmarking, performance regression testing
- 2018 Parallelizing PNG, part 7: Rust profiling on Linux
- 2019 Tutorial: Profiling Rust applications in Docker with perf
- 2019 Profiling Rust: Rust bindings for the HawkTracer profiler
- 2019 r/ What are best Resources on Profiling and Benchmarking your code?
- 2019 r/ High performance duration measurement
- 2020 Quickly Find Rust Program Bottlenecks Online Using a Go Tool
- 2020 Hardware performance counter support (via rdpmc)
- 2020 Measuring Memory Usage in Rust
- 2020 r/ CPU profiling on Windows?
- 2020 URLO Guidance For Profiling and Benchmarking for Bevy Game Engine
- 2020 Implementing the .NET Profiling API in Rust
- 2021 r/ Benchmarking Tokio Tasks and Goroutines
- 2021 A Better Rust Profiler
- 2022/03 Profiling heap allocation in rust
- 2022/05 Does rust have a visual analysis tool for memory and performance like pprof of golang?
- 2022/05 Some notes on internal working of profiler
Causal Profiling
Performance Optimization
- The Rust Performance Book
- rustc book: Profile Guided Optimization
- Packt: Rust High Performance
- Optimising string processing in Rust
- 2016 Rust vs. C++: Fine-grained Performance
- 2017/04 Eyes Above The Waves: Rust Optimizations That C++ Can't Do
- 2017/04 Eyes Above The Waves: Rust Optimizations That C++ Can't Do (Version 2)
- 2017 How-to Optimize Rust Programs on Linux
- 2017 Rust Performance Pitfalls
- 2018/09 The relative performance of C and Rust
- 2018/11 Under the Hood: How Rust Helps Keep Kentik’s Performance on High
- 2019/06 Brave Improves Its Ad-Blocker Performance by 69x with New Engine Implementation in Rust
- 2019/10 Rust and C++ on Floating-point Intensive Code
- 2019/10 Making the Tokio scheduler 10x faster
- 2020/03 Cheap tricks for high-performance Rust
- 2020/04 Speed of Rust vs C
- 2020/05
jimblandy/context-switch
Comparison of Rust async and Linux thread context switch time. - 2020/05 Making rust as fast as go
- 2020/06 r/ Rust performance: slower than nim in synthetic benchmark - how to improve?
- 2020/07 Building and debugging a high-throughput daemon in Rust
- 2020/07 Performance Comparison: Rust vs PyO3 vs Python
- 2020/08 sled theoretical performance guide
- 2020/09 If you want performance, cheat!
- 2020/09 Optimization - Making Rust Code Go Brrrr
- 2020/11 40 millisecond bug
- 2020/11 A Rising Library Beating Pandas in Performance
- 2021/01 r/ Experience with heap bloat
- 2022/06 Rust Optimization.md · Achieving warp speed with Rust
- SIMD
- Executable Size
Command Line Applications
- Command Line Applications in Rust
- 2017 Writing a Command Line Tool in Rust
- 2017 5 Tips for Writing Small CLI Tools in Rust
- 2017 Testing a Rust Command Line Tool
- 2018 Rust And The Great Cli Awakening
- 2018 Write a Good CLI Program
- 2018 12 Factor CLI Apps
CLI Applications written in Rust
alert-after
artifact
coreutils
exa
fd
ion
iota
just
loc
lsd
rhex
ripgrep
- 2016 Ripgrep code review
rq
staccato
Statistics from the command linesvgcleaner
text
-minimaptin
-summertokei
xsv
Argument Parsing
- Rust by Example: Argument parsing
args
An argument parsing and validation library designed to take some of tediousness out of the general 'getopts' crate.arg_input
ARGF-style input handling for Rust. Library functions to treat input files/stdin as if they were all a big stream.argparse
rust-argparse
is command-line parsing module for rust. It's inspired by python'sargparse
module.argparse-rs
A simple argument parser, meant to parse command line input. It is inspired by the Python ArgumentParser.argonaut
A simple argument parser.clap
A full featured, fast Command Line Argument Parser for Rust.structopt
Parse command line argument by defining a struct. It combinesclap
with custom derive.clap-verbosity-flag
Easily add a--verbose
flag to CLIs using Structoptplease-clap
Pattern-match against Clap subcommands and arguments.thunder
Zero-boilerplate commandline argument parsing in Rust. Write simple commandline applications in Rust with zero boilerplate. Bind Rust functions to CLI functions and options with macros. This crate usesclap.rs
for the actual argument parsing.getopts
A Rust library for option parsing for CLI utilities.clioptions
A very thin wrapper for command line arguments in Rust.
Input
trompt
A simple prompting library for rust.promptly
Simple, opinionated CLI prompting helper.linenoise-rust
A minimal, zero-config, BSD licensed, readline replacement.dialoguer
A command line prompting library.
Output
cursive
A TUI (Text User Interface) library focused on ease-of-use. It uses ncurses by default, but other backends are available.tui-rs
A library to build rich terminal user interfaces or dashboards. The library itself supports four different backends to draw to the terminal. You can either choose from: termion, rustbox, crossterm, pancurses.clicolors-control
A utility library for Rust that acts as a common place to control the colorization for CLI tools.colorizex
pbr
Terminal progress bar for Rust, inspired frompb
, support and tested on MacOS, Linux and Windows.yapb
Lightweight, pure, and unopinionated Unicode progress visualizationindicatif
A Rust library for indicating progress in command line applications to users. This currently primarily provides progress bars and spinners as well as basic color support, but there are bigger plans for the future of this!progress
progress is meant to be a set of useful tools for showing program running progress (as its name) and steps.fui
Add CLI & form interface to your program.text-tables
A terminal/text table prettifier with no dependencies. This library provides very simple table printing using text characters. It has no dependencies besides std.termtables
An ASCII table generator.prettytable-rs
A library for printing pretty formatted tables in terminal.treeline
A library for visualizing tree structured data.
Error Handling
clierr
Non-panicking error handling for small CLI scripts.userror
User-facing error messages for command-line programs.
Other
assert_cli
: Test CLI applications. This crate checks the output of a chile process is as expected.carboxyl
Library for functional reactive programmingcargo_cli
Create a command line interface binary with some common dependencies ((clap || docopt) and error_chain)clams
Clams help building shellsclin
Command completion desktop notificationscrossterm
A crossplatform terminal library for manipulating terminals.foropts
An argument-parsing iteratorlockfile
Create lockfiles that remove themselves when they are droppedquicli
Quickly build cool CLI apps in Rust.rust-clock
Rust library to create a hh:mm:ss CLI clock from seconds or miliseconds.texture
Micro-engine for creating text-based adventurestomlcli
Pretty print and query TOML filesunixcli
Helper library for writing unix command line utilities in Rustyacli
Library for creating CLI tools with a look and feel similiar to Cargo
Configuration Management
- Config management in rust
confy
Boilerplate-free configuration management
Interop
Serializing/Deserializing
Serde
Porting from C to Rust
- 2016 carols10cents/rust-out-your-c-talk
- 2016 How to translate a large C project to Rust
- 2016 Porting a few C functions to Rust
- 2017 A Guide to Porting C and C++ code to Rust
- 2018 Porting C To Rust
C
- 2015 Rust Once, Run Everywhere
- 2016 Working with C unions in Rust FFI
- 2017 Bindgen: awesome Rust tool for generating C bindings
Erlang & Elixir
- 2018 Erlang. Safe optimization with NIF on Rust
- Rustler
- Erlang NIF Sys
- Erlang Rust NIF
- Bitwise Rust
- 2014/06 Erlang NIF in pure Rust
- 2020/01 When Elixir's performance becomes Rust-y
- 2022/08 Getting Rusty with Elixir and NIFs
Python
- 2019 Rust-scales Python: Basic Experiment
- 2019 Rust-scales Python: Some examples (1)
- 2019 Rust-scales Python: Flask Experiment
Algorithms
- github.com/TheAlgorithms/Rust
- Learning Rust With Entirely Too Many Linked Lists
- 2018 Why Writing a Linked List in (safe) Rust is So Damned Hard
- Rust Data Structures and Algorithms
- Cracking the Coding Interview with Rust
- Contest Algorithms in Rust - Github
- Rust for algorithms
- Fast Euler Solutions in Rust
- The Computer Language Benchmarks Game - Rust versus C
- Count Luck
- Breaking the Enigma Code With Rust
- Rust, Lifetimes, and Collections
- Rust, Generics, and Collections
- Rust Collections Case Study: BTreeMap
- Building a HashMap in Rust - Part 1: What's a HashMap?
- Pre-Pooping Your Pants With Rust
- Rust Algorithm Club
- Hands-On Data Structures and Algorithms with Rust Code
Combinatorics
combination
A lib to do math jobs like permutate and combinate data from vec.combinatorics
Dual library for calculating combinatorics in both Rust and Ruby (with Rust integration).gen-combinations
This crate give you all the combinations of values in a vec.rust_combinatorics
Combinatoric utilities and functions for rusticub3d_combinatorics
A collection of combinatorics utilities.
Sorting
Searching
- 2016/07 Binary Search
Hashing
sfackler/rust-phf
Compile time static maps for Rust.servo/rust-fnv
Fowler–Noll–Vo hash function.- 2016/11 Accidentally Quadratic — Rust hash iteration+reinsertion
- 2017/09 r/ What is the preferred way of doing HashMaps and HashSets keyed with non-copy values?
- 2017/11 Implementing a key-value store, part 1: Linear Hashing
- 2017/11 Implementing a key-value store, part 2: Linear Hashing implementation in Rust
- 2017/11 Disk-based algorithms: External merge-sort
- 2022/06 rust-phf: the perfect hash function r/
Judy Arrays
adevore/rudy
Judy array implementation in pure Rust
Graphs
Evaluation Graphs
nannou-org/gantz
A crate for creating and evaluating executable directed graphs at runtime. In other words, gantz allows users to compose programs described by interconnected nodes on the fly.
Probabilistic Data Structures
crepererum/pdatastructs.rs
Simple probabilistic data structures
State Machines
- 2015 Rust and the most elegant FSM
- 2016 Pretty State Machine Patterns in Rust
- 2018 Reddit: What do you guys use for coding state machines?
- 2019 The Typestate Pattern in Rust
- 2019 Practical Rust Web Development - State Machine
- 2020 A Fistful of States: More State Machine Patterns in Rust
- State Machines: Introduction — 2020-03-30
- State Machines II: an enum-based design — 2022-08-23
- State Machines III: Type States — 2023-01-02
- 2020 Rust: Pushdown Automata
extfsm
Extended Finite State Machine with internal event queue and entry/exit transitionsfinite-automata
A collection of extendable finite automata with immutable state and transition data.finny
Finite State Machines with a procedural builder-style API and compile time transition checks.fsm-rust-jb
Simple FSM (with effects, like Mealy machine) implementation in Rustfsm
A simple Finite State Machine library, provide State and Event types, then create a machine with an initial state, give it some transition behaviours and you have your state machine!funfsm
An FSM library where the states are functionsmachine
State machine utilitiesmacro_machine
State machine generator using macros.microstate
Finite state machine, inspired by micromachinemode
A behavioral state machine library written in Rustpakr-fsm
Template to implement finite-state-machinesrust-fsm-dsl
Macros for rust-fsm DSLrust-fsm
A framework for building finite state machines in Rustrustlex_fsa
Library for manipulating (deterministic) finite automatasm
a static State Machine librarystatemachine
Provides utilities for working with statemachines.
Entity Component Systems
- Are We Game Yet? ECS
rust-gamedev/ecs_bench_suite
generational-arena
slotmap
- 2014/12 Misconceptions of Component-Based Entity Systems
- 2016/01 Building A (Better) Game Engine: Modeling State And Behavior
- 2016/05 BA(B)GE: The "Ideal" Component System
- RustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West
- 2019/12 A Thought Experiment: Using the ECS Pattern Outside of Game Engines
- 2019/08 Managing Memory in Rust: Entity-Component Systems
- 2020/03 ECS Designs and The Vision of Amethyst
- 2020/08 Bevy Engine – Addressing the elephant in the room
- 2020/11 ECS scheduler thoughts, part 1
- 2021/03 Tutorial: Writing a tiny Entity Component System in Rust
SPECS
- Homepage
specs
- 2017/03 Building a parallel ECS in Rust
- 2017/03
- 2018/05 URLO ECS (with specs) for turn-based game
- 2019/01 URLO Rust 2019 Wish: Improve on Entity-management and Indexing (Slab, Specs, etc…)
- 2020/01 Implementing a Turn-Based Game in an Entity Component System with SPECS-Task
- 2020/06 Fork-join multitasking for SPECS ECS
Legion
hecs
hecs
- 2020/10 ECS in Rust
Bevy ECS
Bevy ECS is a fork of hecs which in turn is a trimmed down version of Legion.
Games
Amethyst
- Amethyst.rs
- 2020/08 A fresh step forward - Proposal for future development and collaboration
- 2020/08 A fresh step forward P2 - The Engine
GGEZ
Piston
Bevy
Rapier
Roguelikes
Graphics
Nannou
User Interfaces
Druid
Storage & Data Bases
Sled
TiKV
TiDB
Noria
Apache Arrow
Timely & Differential Dataflow
Text Search
Tantivy
Sonic
Meilisearch
Operating Systems
TockOS
Redox
Cloud
AWS
- AWS SDK for Rust
- A Rust runtime for AWS Lambda
Embedded
- The Embedded Rust Book
- probe.rs
- probe-run, run embedded Rust apps like native apps
- 2019 Visual Embedded Rust Programming with Visual Studio Code
- 2019 Advanced Topics for Visual Embedded Rust Programming
- 2020 Learning embedded Rust by building RISC-V-powered robot - Part 1
- 2020 Learning embedded Rust by building RISC-V-powered robot - Part 2
- 2020 Learning embedded Rust by building RISC-V-powered robot - Part 3
- 2020 Learning embedded Rust by building RISC-V-powered robot - Part 4
- 2020 Why Rust is a great fit for embedded software
- 2020 Rust on STM32: Getting started
- 2020 As above, so below: Bare metal Rust generics 1/2
- 2020 As above, so below: Bare metal Rust generics 2/2
- 2020 r/ Embedded Rust - Structure initialization with Option
Cross Compiling
- 2017 Everything you need to know about cross compiling Rust programs!
- 2017 Cross-compiling Rust for the Raspberry Pi on macOS
- 2017 Cross Compiling Rust for the Raspberry Pi on Linux
- 2018 Seamlessly Cross-Compiling Rust for Raspberry Pi
- 2018 Cross compiling Rust for ARM (e.g. Raspberry Pi) using any OS!
Programming Language Technology
Parsing
LARLPop
Nom
nom
- Choosing a combinator
- Making a new parser from scratch
- 2018/05 nom 4.0: faster, safer, simpler parsers
- 2020/04 r/ A JSON parser written with Nom 5
- 2020/04 Error recovery with parser combinators (using nom)
- 2022/02 Parsing bitstreams with Nom
Menhir
Pratt Parsers
Chumsky
Tree Sitter
LLVM
- LLVM Tutorial - Kaleidoscope: My First Language Frontend
rusty-kaleidoscope
iron-kaleidoscope
kaleidoscope
kaleidoscope-rust
llvm-kaleidoscope-rs
kaleidoscope-rust
Rustc Compiler
- IRLO
- Guide to Rustc Development
- Rustc Nightly API docs
- Rust Compiler Error Index
- RFCs
- Compiler Team
- 2016 Rust compiler walk-through - Introduction
- 2017 Optimizing Rust Struct Size: A 6-month Compiler Development Project
- 2018 How Rust Implements Tagged Unions
- 2019 The steps towards rustc, the great optimiser
Rust Compilation Speed
- perf.rust-lang.org
- Benchmarking the Rust compiler
- NNethercote's Mozilla Blog
- How to alleviate the pain of Rust compile times
- How to speed up the Rust compiler
- How to speed up the Rust compiler some more
- How to speed up the Rust compiler in 2018
- How to speed up the Rust compiler some more in 2018
- How to speed up the Rust compiler in 2018: NLL edition
- The Rust compiler is getting faster
- The Rust compiler is still getting faster
- How to speed up the Rust compiler in 2019
- Visualizing Rust compilation
- How to speed up the Rust compiler some more in 2019
- How to speed up the Rust compiler one last time in 2019
- How to speed up the Rust compiler in 2020
- How to speed up the Rust compiler some more in 2020
- How to speed up the Rust compiler one last time
- How to speed up the Rust compiler in 2022
- How to speed up the Rust compiler in April 2022
- How to speed up the Rust compiler in July 2022
- PingCap Blog
- 2018 How to alleviate the pain of Rust compile times
- 2019 r/rust What compilation profiling tools do you recommend?
- 2020/20 8 Solutions for Troubleshooting Your Rust Build Times
- 2021/09 Fast Rust Builds HN
- 2021/12 Tips for Faster Rust Compile Times
- 2022 Compiler performance roadmap for 2022
- 2022/07 Youtube: Making a Rust crate compile faster
- 2022/09 Speeding up incremental Rust compilation with dylibs r/rust
Cranelift
GCC-Rust
- github.com/Rust-GCC/gccrs
- Philip Herrons Personal Blog - Compilers and stuff
- 2021 Open Source Security, Inc. Announces Funding of GCC Front-End for Rust
Notes
Q
is there a way to pass an enum's variant as argument (somehow)?
I have a recursive enum, like: enum Rec { V1, V2(Box<Rec>, Box<Rec>) }
If I am in function A, I have a Rec r, but I know for a fact that it matches variant V2, how can I declare a function that only takes V2's?
It's very annoying to always have to test whether my input Rec matches V2, I would like to do that from the type system pov
instead of just always assert at the beginning of the function that only takes V2
I mean, basic polymorphism I guess.
I've seen solutions saying to have an extra struct with the contents of that variant to make a type out of it, and then the variant just wraps that struct.
A
usually an extra struct and then fn {as,into}_v2(self) -> Option<V2Data> functions are quite common so you can do
let r = Rec::V2(..);
if let Some(v2) = r.as_v2() {
v2.do_stuff()
}