Termine
Die Vorlesung findet in Raum W3.03 statt.
Termine
Die Vorlesung findet in Raum W3.03 statt.
Warum Rust?
Rust erfordert explizites Nachdenken über Speicherverwaltung und Ressourcennutzung. Dies macht Rust ideal für systemnahe Programmierung, wo Performance und Sicherheit wichtig sind. https://www.rust-lang.org/
Primär-Literatur 📚
Copyright
Diese Dokumentation steht unter der Creative Commons Lizenz Namensnennung/Keine
kommerzielle Nutzung.
Technische Hochschule Augsburg
Von Lobste.rs
miro: A native pdf viewer for Windows and Linux (Wayland/X11) with configurable keybindings
QNX Resource Manager in Rust: Message Passing and Resource Managers
Garbage Collection for Rust: The Finalizer Frontier
nanochat: The best ChatGPT that $100 can buy
Avian Physics 0.4
We need (at least) ergonomic, explicit handles
C2BF: A C-to-Brainfuck compiler written in Rust
Async Rust with Tokio I/O Streams: Backpressure, Concurrency, and Ergonomics
magnolia: Interactive shell navigation and history
Making Slint Desktop-Ready
Why we didn't rewrite our feed handler in Rust
walrus: ingesting data at memory speeds
The Handle trait
fibonacci-numbers crate
Servo GTK
Obelisk 0.25.4 and handling of WASM traps
cargo-subspace: Make rust-analyzer work better with very large cargo workspaces
Let me preface all of this by saying that rust-analyzer is an amazing project, and I am eternally grateful for the many people who contribute to it! It makes developing rust code a breeze, and it has surely significantly contributed to Rust's widespread adoption.
If you've ever worked with a very large cargo workspace (think hundreds of crates), you know that rust-analyzer eagerly builds compile time dependencies (e.g. proc macros) and indexes all the crates in your workspace at startup. For very large workspaces, this can take quite a while. Even after indexing is complete, operations like searching for symbols and autocomplete can be laggy. If you often open and close your editor (shout out to all the (neo)vim users out there), it can take a few minutes for rust-analyzer to finish starting up again. Setting check.workspace = false and cachePriming.enable = false can help significantly, but in my experience, they don't solve the problem completely.
After reading through the rust-analyzer manual, I noticed that rust-analyzer supports integrating with third party build tools, like bazel and buck. In short, it is possible to point rust-analyzer to a command that it will invoke with a path to a source code file to discover information about the crate that the file belongs to. This "automatic project discovery" is intended to give third party build tools a way to communicate information about the structure of a project (e.g. the dependency graph) such that rust-analyzer doesn't need to use cargo. I realized that, theoretically, it should be possible to write a tool that still uses cargo under the hood and selectively tells rust-analyzer about a workspace's dependency graph as new files are opened.
That's where cargo-subspace comes in. cargo-subspace is a CLI tool that takes a path to a source code file as an argument and prints out information about the crate that the file belongs to and that crate's dependencies. It works like this:
cargo metadata, which returns the full dependency graph for the workspaceAs you open new files in your editor, rust-analyzer will invoke the tool to discover information about how the crate fits into the larger dependency graph of the workspace, lazily indexing and building compile time dependencies as you go. I've found that this approach significantly reduces rust-analyzer's startup time and makes it much zipper and more stable.
If you frequently work with very large cargo workspaces, I'd love for you to try it out and give me some feedback. I tested it myself and it seems to work the way I'd expect, but I'm sure there are some edge cases I haven't considered. There are also some other features I'm considering adding (e.g. an option to include all the dependents of a crate in the dependency graph and not just the dependencies, the ability to read from an "allowlist" file to always index and load a subset of the crates in the workspace, etc.), and I'd be curious to hear if y'all have any other ideas/requests. Installation and configuration instructions can be found in the README.
Thanks for reading, and happy rusting!
Packing The World For Longest Lines Of Sight
Cancelling async Rust
Serving a half billion requests per day with Rust + CGI
Bevy 0.17
The expression problem and Rust
Sguaba: Type-safe spatial math in Rust
The Gameboy emulator that runs everywhere (Terminal, Web, Desktop)
Comparing Rust to Carbon