rust terminal cube as fast as small as i can make it
Find a file
2024-10-27 02:18:27 -04:00
src fix up io 2024-10-27 02:18:27 -04:00
.gitignore cube (old) 2024-04-12 01:02:49 -04:00
Cargo.lock fix up io 2024-10-27 02:18:27 -04:00
Cargo.toml better build scripts 2024-10-14 18:11:26 -04:00
dev-linux better build scripts 2024-10-14 18:11:26 -04:00
LICENSE.jpg readme and license 2024-10-13 22:47:35 -04:00
README.md readme and license 2024-10-13 22:47:35 -04:00
release-linux better build scripts 2024-10-14 18:11:26 -04:00
rust-toolchain.toml optimize for size 2024-10-03 23:31:23 -04:00

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.