Rusty Russell on Nostr: My second week of Rust (only a few hours a day though: I am on vacation after all) ...
My second week of Rust (only a few hours a day though: I am on vacation after all) has me reproducing and enhancing a tool I wrote in C. It takes multiple lines and runs stats on the numbers in it.
This is useful for quick benchmarks: `for i in $(seq 10); do /usr/bin/time myprog; done | linestats`. Each line with the same literal parts is combined, with numbers replaced by "min-max(mean+/-stddev)".
The C one wasn't very clever about decimals, so it needed a good rewrite. The new code works, but needs polish, more options, optimization, tests and documentation before I release it.
The good thing about these small projects is they don't get hamstrung by Rust's glacial build times!
Published at
2025-12-22 21:15:48 UTCEvent JSON
{
"id": "02b3e6e74a72ba713d31071514d5a768d7d8cc36563f12eb21914ff3c33fc420",
"pubkey": "f1725586a402c06aec818d1478a45aaa0dc16c7a9c4869d97c350336d16f8e43",
"created_at": 1766438148,
"kind": 1,
"tags": [
[
"alt",
"A short note: My second week of Rust (only a few hours a day tho..."
]
],
"content": "My second week of Rust (only a few hours a day though: I am on vacation after all) has me reproducing and enhancing a tool I wrote in C. It takes multiple lines and runs stats on the numbers in it.\n\nThis is useful for quick benchmarks: `for i in $(seq 10); do /usr/bin/time myprog; done | linestats`. Each line with the same literal parts is combined, with numbers replaced by \"min-max(mean+/-stddev)\".\n\nThe C one wasn't very clever about decimals, so it needed a good rewrite. The new code works, but needs polish, more options, optimization, tests and documentation before I release it.\n\nThe good thing about these small projects is they don't get hamstrung by Rust's glacial build times! ",
"sig": "10f0afc5481998c3dec674b1085b3a4037acde0496f1cdbc2f0a2fb5698bbad175d497968eda42cba44be154a418dabcc10090c37961a7a20af8accd53862b93"
}