-
Rust links
-
- Tracking issue for generic associated types (GAT)
- Tracking issue for const generics
- Splitting the const generics features
- Tracking Issue for
min_const_generics
- stabilize
#![feature(min_const_generics)]
in 1.50 min_const_generics
prevents references to concreteSelf
param- Shipping Const Generics in 2020
- Making elementwise operations using const generics more ergonomic? (Possible new trait or FromIterator impl)
- Implementing ArrayVec Using Const Generics
- Add section ch19-07 on Const Generics
- Preserving the programmers ‘Intent’ in Unsafe Rust
- stabilize
- Tracking issue for "Lazy normalization"
- check it tl;dr it works!
#![feature(const_generics)] struct MyVec<T: Sized, const LENGTH: usize> { inner_data: [T; LENGTH], } impl<T: Copy, const L: usize> MyVec<T, L> { pub fn new(value: T) -> Self { MyVec { inner_data: [value; L], } } } fn main() { let _my_vec = MyVec::<f64, 10>::new(4.2); println!("_my_vec[0] : {}", _my_vec.inner_data[0]) }
- Tracking Issue for complex generic constants (
const_evaluatable_checked
)
- Tracking issue for specialization (RFC 1210)
- [Analysis / Pre-RFC] Variadic generics in Rust
-
Jon Gjengset's playlists
-
[Rust projects]
-
Awesome Rust: A curated list of awesome Rust code and resources
-
Are we yet?
-
Rust ownership, lifetimes and borrowing
-
Performance Tips
- Rust Performance Pitfalls
- Profiling Rust applications on Linux
- Intro to rustc's self profiler
- A Better Rust Profiler
- Rust vs. C++: Fine-grained Performance
operf ./target/debug/add_sum_sq -k 4 -n 100 opannotate --source --assembly > operf.listing
-
Learn Rust the Dangerous Way
- Why Learn Rust the Dangerous Way?
- You Can't Write C in Just Any Ol' Language: Learn Rust the Dangerous Way, Part 1
- References Available Upon Request: Learn Rust the Dangerous Way, Part 2
- Measure What You Optimize: Learn Rust the Dangerous Way, Part 3
- A More Perfect Union: Learn Rust the Dangerous Way, Part 4
- Making Safe Things From Unsafe Parts: Learn Rust the Dangerous Way, Part 5
- Let The Compiler Do The Work: Learn Rust the Dangerous Way, Part 6
-
I wrote my Bachelor's thesis about Go and Rust in high-performance computing
- bachelor's thesis titled "Evaluation of performance and productivity metrics of potential programming languages in the HPC environment"
- Evaluation of C, Go, and Rust in the HPC environment
- Evaluation of performance and productivity metrics of potential programming languages in the HPC environment - A comparison of Rust, Go and C -- University of Hamburg
- Rust programs versus Go by benchmark task performance
-
How to explain slowdown with Sieve of Eratosthenes versus Nim and C?
-
Linear Algebra + Numerics
-
faer is a collection of crates that implement low level linear algebra routines in pure Rust
-
Scientific computing: a Rust adventure [Part 1 - Zero-cost abstractions]
-
Ventifact’s Linear Algebra. A place for learning about and sharing linear algebra.
-
Surface reconstruction library and CLI for particle data from SPH simulations
-
FENRIS: A Rust library for building advanced applications with the Finite Element Method (FEM)
-
Polsim - a case study for small-scale scientific computing in Rust
-
delaunator-rs A very fast static 2D Delaunay triangulation library for Rust. A port of Delaunator
-
Implementation of a 2-dimensional MAC (marker and cell) fluid solver in Rust
-
- Rust Delaunay Triangulation
- Rust Discontinuous Galerkin
- Rust Symbolic Algebraic
- [Open Rust CFD: A 3D, unstructured computational fluid dynamics (CFD) solver](https://github.com/reidprichard/ORC
-
A Linear Algebra library that uses const generics to be no_std and specialization to enable SIMD
-
ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations
-
UKF written in Rust based on the C++ UKF from the Udacity SD Car Nanodegree
-
Arrayfire
-
ArrayFire: a general purpose GPU library. http://arrayfire.com
-
requisites
-
GLFW
ldd ./lu_cpu ... libglfw.so.3 => not found
git diff -u CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index aa22cc3..0fb3c0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib set_property(GLOBAL PROPERTY USE_FOLDERS ON) -option(BUILD_SHARED_LIBS "Build shared libraries" OFF) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
- add to
.bashrc
# used to be for ArrayFire #export AF_PATH=$HOME/work/arrayfire-3 #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AF_PATH/lib # now # for openblas-provider # see [OpenBLAS: Detecting CPU failed during build](https://github.com/JuliaLang/julia/issues/394) # symptome: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared export CARGO_FEATURE_SYSTEM_OPENBLAS=1 # for arrayfire-rust export AF_PATH=/usr
- use ArrayFire
mkdir build pushd build cmake -DArrayFire_DIR=$AF_PATH/share/ArrayFire/cmake .. make VERBOSE=1
-
-
-
-
async
- Are we async yet?
- The What and How of Futures and async/await in Rust
- Comparison of Rust async and Linux thread context switch time and memory use
- A practical guide to async in Rust
- Different levels of async in Rust
- History and status quo of async/non-blocking I/O in Rust?
- Stateful: A Rust Experimental Syntax Extension for Generators and More
- Pretty State Machine Patterns in Rust
- Async IO for Rust (part II)
- Condition variable not playing well with
thread::sleep
-
Rust parser generators
-
On Rust goals in 2018 and beyond tl;dr rust sucks for numerics
-
rusty-tags : Create ctags/etags for a cargo project and all of its dependencies
-
Rust patterns
- Common data structures and algorithms in Rust
- A catalogue of Rust design patterns
- Rust Patterns: Using traits for function overloading
- Dependency Injection in Rust
- Dependency injection container - Learning the ropes in Rust
- Rust's flawed dynamic type
- Mixing matching, mutation, and moves in Rust
- Polymorphism in Rust: Enum vs Trait + Struct
- Implementing an object factory pattern in Rust using closures
- Typestates in Rust
-
Rust concurrency
- Rust Atomics and Locks
- Gregory Terzian
- Comparing parallel Rust and C++
- Concurrent Programming in Rust course EECS 3/495
- An Adventure in API Design and Concurrency in Rust
- Lock free stack
- Learn Rust: Dining Philosophers runs not concurrent
- parry - Parallel array processing: deflect performance problems
- crossbeam - Support for parallelism and low-level concurrency in Rust
-
Books, Docs: generation, in Russian, vs. C++
-
Abstracted Algebra in Rust, or, Why Rust is better than C++, part I
-
Adam Leventhal's blog: First Rust Program Pain (So you can avoid it...)
-
Thorin/Impala paper: A Graph-Based Higher-Order Intermediate Representation
-
Misc
-
Why does serde_json::to_writer not require its argument to be
mut
? -
Rust library for opening and working with dynamic link libraries
-
Rust, дисциплинирующий язык программирования
- Основы Rust – Глава 2. Использование переменных и типов
- Обработка ошибок в Rust
- Сопоставление с образцом, изменения и перемещения в Rust
- Сравнение производительности языков на примере простейшего классификатора
- Заимствование и время существования в Rust
- Создаём REST-сервис на PostgreSQL и Rust. Часть 1: прототип
- Создаём REST-сервис на Rust. Часть 2: читаем INI; multirust
- Создаём REST-сервис на Rust. Часть 3: обновляем базу из консоли
- Создаём REST-сервис на Rust. Часть 4: переходим к REST API
- Создаём REST-сервис на Rust. Часть 5: обработчики, рефакторинг, и макросы
- Rust в деталях: пишем масштабируемый чат с нуля, часть 1
-
Porting to Rust
-
RustType is a pure Rust alternative to libraries like FreeType
use std::fs::File; use std::io::Read; fn main() { let mut file=File::open("Cargo.toml").unwrap(); let mut buf=[0u8;12]; file.read(&mut buf).unwrap(); println!("{:?}",buf); // use file }
-
Effectively Using Iterators In Rust
let vec1 = vec![1, 2, 3]; let vec2 = vec![4, 5, 6]; // `iter()` for vecs yields `&i32`. Destructure to `i32`. println!("2 in vec1: {}", vec1.iter() .any(|&x| x == 2)); // `into_iter()` for vecs yields `i32`. No destructuring required. println!("2 in vec2: {}", vec2.into_iter().any(| x| x == 2));
-
confusing error "ambiguous associated type" on missing enum variants
-
-
Useful tips
# for cargo export CARGO_HOME=$HOME/.cargo export RUST_SRC_PATH=$HOME/work/github/rust/src export PATH=$CARGO_HOME/bin:$PATH
cargo install --git 'https://github.com/phildawes/racer.git' cargo install --git https://github.com/nrc/rustfmt echo 'pub fn main(){println!("hello");}' | rustfmt
pub fn main() { println!("hello"); }
an `extern crate` loading macros must be at the crate root
put the
#[macro_use] extern crate serde_derive;
in the crate root, which ismain.rs
and/orlib.rs
-
Misc.
-
A vantage-point tree implementation backed by vectors for good performance with no unsafe code
-
//! Example #![warn(missing_docs)] #[macro_use] extern crate from_variants; /// A sample struct. #[derive(Debug, Clone, FromVariants)] pub enum Lorem { /// Hello world #[from_variants(skip)] Str(String), /// Hello world Num(u16), } fn main() { println!("{:?}", Lorem::from(10)); }
generated
#[doc = "Convert into a `Num` variant."] impl ::std::convert::From<u16> for Lorem { fn from(v: u16) -> Self { Lorem::Num(v) } }
-
Rustdoc: reStructuredText vs Markdown: On The Potential Inadequacy of Markdown
-
cargo-tree produces
$ cargo tree chrono v0.2.17 (file:///Volumes/git/rust/rust-chrono) ├── num v0.1.29 │ ├── rand v0.3.12 │ │ ├── advapi32-sys v0.1.2 │ │ │ ├── winapi v0.2.5 │ │ │ └── winapi-build v0.1.1 │ │ ├── libc v0.2.4 │ │ └── winapi v0.2.5 (*) │ └── rustc-serialize v0.3.16 ├── rustc-serialize v0.3.16 (*) ├── serde v0.6.6 │ └── num v0.1.29 (*) ├── serde_json v0.6.0 │ ├── num v0.1.29 (*) │ └── serde v0.6.6 (*) └── time v0.1.34 ├── kernel32-sys v0.2.1 │ ├── winapi v0.2.5 (*) │ └── winapi-build v0.1.1 (*) ├── libc v0.2.4 (*) └── winapi v0.2.5 (*)
use std::ops::Add; fn foo<Num>(n: Num) -> Box<FnMut(Num) -> Num> where Num: Add<Output=Num> + Copy + 'static { let mut acc = n; Box::new(move |i: Num| { acc = acc + i; acc }) } fn main() { let mut x = foo(1.); x(5.); foo(3.); println!("{}", x(2.3)); }
-
Ideas, RFCs, that are not in the language yet
- HKT
- What Are Sum, Product, and Pi Types?
- Rust/Haskell: Higher-Kinded Types (HKT)
- Blog post series: Alternative type constructors and HKT
- Pi types v2 (const generics)
- [lang-team-minutes] Const generics
- with-bounds-in-pi-types
- RFC: Constant generics (restricted Π types) for Rust, core RFC (v2)
- Generics over the size of an array type (in anticipation of const generics)
- Associated Consts
- Associated constant doesn’t exist?
- Generic associated consts can't currently be used to parameterize fixed array lengths tl;dr it works!
#![feature(associated_consts)] trait Const { const VALUE: usize; } struct Foo; impl Const for Foo { const VALUE: usize = 4; } fn test(x: [u8; Foo::VALUE]) { for _ in x.iter() { println!("hello"); } } fn main() { let x = [1,2,3,4]; test(x); }
- Dissertation on Algebraic Subtyping
- Higher-kinded type trait
- GitHub Gist for HKT
- Rust and the Monad trait - Not just higher kinded types
- Reddit: Rust and the Monad trait - Not just higher kinded types
- Higher Kinded Types
- Does rust really need higher kinded types?
step_by
on negative numbers- GPU support
- HKT
-
Unable to create a polymorphic type because the trait cannot be made into an object
-
- Crate katex_doc
- horrible-katex-hack
- rustdoc-katex-demo
- Add Mathjax (KaTeX?) Support to Rustdoc #16300
- Add mathematics support to rustdoc #17390
- Rustdoc: reStructuredText vs Markdown
- Embedding LaTeX in Rust documentation?
- Snekdown - More than just Markdown
- Minimal Rust project example for using Latex in docs
- The Tectonic Typesetting System
- ReX - typesetting mathematics
- Extending the Literate Programming Tool Tango
- mdBook
-
GC in Rust
-
- linfa aims to provide a comprehensive toolkit to build Machine Learning applications with Rust
- A linear algebra library in Rust designed for machine learning
- Linear Algebra in Rust
- rustlearn - A machine learning package for Rust
- autograph - Machine Learning Library for Rust
- Nengo RS is an experimental Nengo backend written in Rust
- tch-rs : Rust bindings for the C++ api of PyTorch
-
rand : A Rust library for random number generators and other randomness functionality.
-
A native-rust implementation of an Effect monad, inspired by PureScript's EFF Monad
-
pijul - distributed version control system written in Rust
- Commutation and scalability in pijul, the new version control system written in Rust
- Add Pijul support to Cargo
- Pijul: Sane Version Control (Pierre Étienne Meunier)
- Announcing Pijul 1.0 beta, a Version Control System written in rust
tl;dr
cargo install pijul --version "~1.0.0-beta" --features git
-
Hardware (bare metal) - OSes, ISA simulators,etc.
-
DBus
- DBus projects in Rust
- A D-Bus binding for Rust
- dbus-rs/src/message.rs
- argument_guide
- Struct dbus::arg::Iter tl;dr
struct ServiceBrowserItemNew { interface: i32, protocol: i32, name: String, item_type: String, domain: String, flags: u32, } fn service_browser_item_new_msg(m: &Message) -> Result<ServiceBrowserItemNew, TypeMismatchError> { let mut iter = m.iter_init(); Ok(ServiceBrowserItemNew { interface: try!(iter.read()), protocol: try!(iter.read()), name: try!(iter.read()), item_type: try!(iter.read()), domain: try!(iter.read()), flags: try!(iter.read()), }) }
-
A comparison of operating systems written in Rust
- Writing a Linux-compatible kernel in Rust
- Redox: A Rust Operating System
- Theseus: an Experiment in Operating System Structure and State Management + Theseus: an Experiment in Operating System Structure and State Management: slides + OSDI '20 - Theseus: an experiment in operating system structure and state management + Theseus OS: OSDI 2020 Long Talk
- MOROS: Obscure Rust Operating System
-
rustv - A minimal, intentionally inaccurate RISC-V ISA simulator
-
CLOCK-Pro: An Effective Improvement of the CLOCK Replacement
-
-
Formal Verification
- rsmt2
- Synthesizing Loop-Free Programs with Rust and Z3
- Simple verification of Rust programs via functional purification
- A Formal Verification of Rust's Binary Search Implementation
- GitHub - Kha/electrolysis: Simple verification of Rust programs via functional purification
- Electrolysis Reference
- Status of Rust Code Analyzers
- Pre-RFC: Extending where clauses with limited formal verification
-
C & C++ projects being converted to Rust
-
Physically Based Rendering
-
Think Bayes
-
Algorithms and Concepts from Stepanov's "Elements of Programming"
-
Editors
-
Rewritten in Rust: Modern Alternatives of Command-Line Tools
- Text search-and-replace & Find (grep-like tools)
-
Awesome Rewrite It In Rust - A curated list of replacements for existing software written in Rust
-
-
Video
-
Linux distros Rust support
-
Run Rust code on your NVIDIA GPU
-
Rust & CUDA OpenCL
-
diagrams using Rust
cargo install svgbob_cli svgbob < examples/long.bob > long.svg svgbob -o long.svg < examples/long.bob svgbob examples/long.bob > long.svg
-
Graphics in Rust
-
- Awesome wgpu
- Native WebGPU implementation based on gfx-hal
- Rust bindings to wgpu native library
- Universal shader translation in Rust
- Graham scan from Algorithms in a Nutshell in Rust
- Plexus is a Rust library for 2D and 3D mesh processing
- Vulkan bindings in Rust
- A low-overhead Vulkan-like GPU API for Rust
-
Rust and OpenGL from scratch
-
Rust Computer Vision CV
-
Rust robotics
-
ROS stands for Robot Operating System
-
WIP : Selected RFCs
-
- Tracking issue for const generics (RFC 2000)
- WIP The Genesis of Generic Germination
- To summarise, this PR is being split out into smaller ones:
- WIP The Genesis of Generic Germination
- generic-array : in anticipation of const generics
tl;dr
generic-array defines a new trait
ArrayLength<T>
and astruct GenericArray<T, N: ArrayLength<T>>
, which let the above be implemented as:
struct Foo<N: ArrayLength<i32>> { data: GenericArray<i32, N> }
- Tracking issue for const generics (RFC 2000)
-
embedded Rust
- Cross compile for ARM
- Real Time For the Masses
- Rust Embedded. Разработка под процессоры Cortex-M3 на примере отладочной платы STM32F103C8T6 (Black Pill)
- (unofficial) Embedded Rust HAL Guidelines
- Tock is an embedded operating system designed for running multiple concurrent, mutually distrustful applications on Cortex-M and RISC-V based embedded platforms
- Bobbin is an open-source, cross-platform, vendor-independent development system for embedded programming in the Rust programming language
-
misc
-
This is a collection of implementations of algorithms and data structures in Rust language
-
Is there any way to get the address of a
struct
in Rust?- A sampling CPU profiler for Linux similar to perf
- gimli
- Switching the backtrace crate to using object
- cpp_demangle: a C++ linker symbol demangler
- A DWARF unwinder based on gimli tl;dr
let text = AddrRange { start: &__text_start as *const _ as u64, end: &__text_end as *const _ as u64, }; let eh_frame_hdr = AddrRange { start: &__ehframehdr_start as *const _ as u64, end: &__ehframehdr_end as *const _ as u64, }; let eh_frame_end = &__ehframe_end as *const _ as u64;
-
Logic in Rust
git clone --bare https://github.com/rust-lang/crates.io-index.git
- Языковое замещение, или Почему Rust сменяет C
- Zero To Production #1: Setup - Toolchain, IDEs, CI
- Zero To Production #2: Learn By Building An Email Newsletter
- The Rust Compilation Model Calamity
- Generics and Compile-Time in Rust
- Automatic Differentiation/Differential Programming Support
- Do the compilers really create more optimal code for Rust than for C/C++?
- Get next
n
items from an iterator with const generics - FFI
- clap
- clap::_derive::_tutorial
- Clap: is it possible to have options with multiple values rather than multiple repeats? tl;dr
/// Dissassemble given sections #[arg(short, long, num_args(1..))] // at least one section, such as .text disasm: Option<Vec<String>>,
-
I want to implement add trait for a struct which imlpements Fn trait
-
A dependency-free chess engine library built to run anywhere
-
Is this the right way to read lines from file and split them into words in Rust?
-
Alignment of floating point numbers printed in scientific notation
-
HVM: a next-gen massively parallel, beta-optimal functional runtime is 50x faster than its predecessors
-
Sunrise