src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
dev-linux | ||
LICENSE.jpg | ||
README.md | ||
release-linux | ||
rust-toolchain.toml |
cube
i first wrote this program in java for a programming class. i figured a rotating cube in a terminal would be reasonably simple but interesting and informative to implement. java sucks ass.
rust has crates for proper vector types with operator overloading so i ported it over just to see how i could simplify it.
while making it i had trouble handling SIGINT. when the user goes back to the shell the program should send ansi escapes to reset everything and show the cursor. the only way i could find at the time was tokio, which prevented me from locking stdout.
i later wanted to make a small executable for sending around, i figure a simple program like this should be under 20kb.
the rust "ctrlc" crate pulls in so much code that it adds over 50kb to the binary just for one handler. unfortunately i haven't found any minimal crate to add an interrupt handler so i ended up just implementing it myself for using with libc.
i don't have a windows machine to test one and supporting linux is hard enough so i haven't bothered to support windows.
during the process of writing this program i lost all respect for musl and the libc standard since i found there are no good ways to write to a file after locking it, completely defeating the point.
at this point i'm just trying to make the executable as small as i can get it.