Porting the guff plot device to Rust

Channel:
Subscribers:
97,800
Published on ● Video Link: https://www.youtube.com/watch?v=bbWcGAOsbIE



Duration: 0:00
30,157 views
529


For this stream, I wanted to implement something in Rust where we didn't also need to learn a new technical topic, and instead could focus just on the "writing Rust" part. After digging around for a bit, I came across https://github.com/silentbicycle/guff in my old bookmarks — it's a command-line tool that takes a stream of data on STDIN, and plots it to your terminal using good-ol' ASCII (no ncurses interface or TUI or anything, just prints). guff was last updated 10 years ago, and is written in plain C, so felt like a good candidate for a refresh that we could also add functionality to.

You can find `dings`, the resulting port, at https://github.com/jonhoo/dings/, and the commit at the end of the stream at https://github.com/jonhoo/dings/commit/e7e7a8f4487cc620719a0672c92b3fe8dd232212.

You can join my Discord at https://discord.jonhoo.eu/

0:00:00 Exploring guff
0:59:44 Gathering data
2:16:38 Scaling to terminal
2:58:52 Adding axes
3:29:23 f64 rounding
3:46:07 Counting mode
4:08:28 What are CDFs?
4:26:47 Time to organize the code
4:58:57 Adding the CDF transform
5:36:17 Adding log(x) and log(y)

Live version with chat: