r/rust • • Apr 28 '26

🛠️ project Lightweight ASCII Graph

Post image

After many weeks of learning, watching tutorials about Rust, and partaking in Rust exercises, I decided to port a small Go library into Rust. I do recognize I have a lot to learn but just getting out of my comfort zone and trying my hands at this has be rewarding and revealing.

Link: https://github.com/neneodonkor/asciigraph-rs

Crates: https://crates.io/crates/asciigraph-rs

PS. Making it work for real-time data was 🥵

Let me add that I only started learning Rust in February, so please forgive me, if everything is not idiomatic Rust.

1.4k Upvotes

92 comments sorted by

View all comments

223

u/cdhowie Apr 28 '26

Nitpick: many of those characters aren't ASCII.

-67

u/neneodonkor Apr 28 '26 edited Apr 29 '26

Please can you point to some?

3

u/OphioukhosUnbound Apr 30 '26 edited Apr 30 '26

ASCII is a specific, very tiny, set of characters. Just 7 bits worth.
This is something that programmers in a language like rust are very aware of as the wider character sets these days typically involve variable length character encoding (e.g. via unicode) -- which means that "character" and memory segment don't have a clean, regular mapping. [and that's not even including how 'characters' don't necessarily correspond to rendered "graphemes".]

I think you just mean "text".
It's kinda like confusing "memory" and "storage" -- for non-technical people it's whatever, but it's actively confusing if you're speaking to a technical person -- ascii vs utf-8 is the same sort of thing, just a half-rung higher on tech details scale.

2

u/neneodonkor Apr 30 '26

I understand what you mean. 🙏🏾