# Macros This book is pretty concise and clear: <https://danielkeep.github.io/tlborm/book/pat-push-down-accumulation.html> Great for intermediate-level Rust developers. # Const expressions Const expressions are an powerful way to make compile-time checks in your code. They are especially powerful when paired with *macros*. A const expression supports `match` statements and *basic* uses of `panic!` (no format strings, sadly). Annotate `const fn`s with `#[track_caller]` to get more helpful error messages, pointing you to the source of the error! # Libraries ## Sync - [Parsell](https://github.com/asajeffrey/parsell) - LL1 parser generator based on nom and [[Haskell]]'s Monadic parsing - [Ratatui](https://ratatui.rs/) - fork of tui-rs, terminal-based GUIs - [url](https://docs.rs/url/latest/url/) - Library for URLs - [Lettre](https://github.com/lettre/lettre) - Mailer (SMTP) library - [open](https://docs.rs/open/latest/open/) - open files and links via the standard system opener program (ex. `xdg-open`) - [strum](https://crates.io/crates/strum) - let's you iterate over `enum`s - [combine](https://docs.rs/combine/latest/combine/index.html) - a feature complete LL(1) (and optionally, LL(k)) parser combinator library. Robust, maintained, and pretty nice. - [difference](https://docs.rs/difference/latest/difference/) - functions for dealing with text diffs - [Glamour](https://docs.rs/glamour/latest/glamour/) - Statically typed vector math - [mdns_sd](https://docs.rs/mdns-sd/) - a mDNS library that supports broadcasting services - [mdns](https://docs.rs/mdns/latest/mdns/) - a mDNS library that supports querying for services - [Petgraph](https://github.com/petgraph/petgraph) - a graph datastructure library - [afl.rs](https://github.com/rust-fuzz/afl.rs) - fuzz testing - [proptest](https://crates.io/crates/proptest) - property testing (similar to fuzz testing) - [colored](https://docs.rs/colored/latest/colored/) - coloring and styling terminal output - [mockall](https://docs.rs/mockall/latest/mockall/) - mocking for traits - [jiff](https://github.com/BurntSushi/jiff) - a datetime library that does things the correct way - [pom](https://github.com/J-F-Liu/pom) - a PEG parser combinator library - [lexopt](https://docs.rs/lexopt/latest/lexopt/) - a pathologically simple cli opt parser - [error_set](https://github.com/mcmah309/error_set) - error handling inspired by [[Zig]]'s error set type ## Async [smol](https://github.com/smol-rs/smol) is a small async runtime (ie. Tokio replacement) that is intended to be lightweight. Has a compatibility layer for Tokio libraries if necessary. # Misc [Ferrocene](https://ferrous-systems.com/ferrocene/) is a ISO 26262 (ASILD) and IEC 61508 (SIL 4) qualified version of the Rust compiler based on version `1.68`. [scope-tui](https://github.com/alemidev/scope-tui) is a oscilloscope/vectorscope/spectroscope TUI library # Projects ## In-progress - [[TSK]] - [[BARE]] messaging parser-generator + Serde derive ## Ideas - Google Fire-like macro library that turns methods/functions into a CLI app with tab completion and automatic argument generation. # Debugging Use gdb or lldb. If using binutils strip utility, you can also get a separate file with *just* the debug symbols (before stripping) with: ```shell objcopy --only-keep-debug <binary> <output> ``` You can then load up that debug file in gdb after attaching to a process with `symbol-file /path/to/output.symbols` file. It's not quite as good as a `--debug` build, but it *will* work.