Skip to content

🦀 THE GREAT OXIDATION: Converting this Go-pher into a Fearless Crab 🦀#2

Open
viemmsakh wants to merge 5 commits into
slipperystairs:mainfrom
viemmsakh:main
Open

🦀 THE GREAT OXIDATION: Converting this Go-pher into a Fearless Crab 🦀#2
viemmsakh wants to merge 5 commits into
slipperystairs:mainfrom
viemmsakh:main

Conversation

@viemmsakh
Copy link
Copy Markdown

Summary

Let’s be honest: Go is fine if you enjoy checking if err != nil every three lines, but we’re living in the future now. I have taken the liberty of rewriting killahtask in Rust, the only language that actually loves you back.

This rewrite (internally dubbed RKT: Rusty Killah Task) provides the same CLI CRUD operations you know and love, but with 100% more borrow-checking and 0% garbage collection pause.

EDIT
Resubmitting PR with current merge conflicts identified in #1 resolved.

Why this is objectively better:

  • Memory Safety: While the Go version was busy worrying about its heap, the Rust version has already cleared its memory before the CPU even knew what happened.
  • Zero-Cost Abstractions: Your tasks will now be completed with the efficiency of a finely-tuned German sports car, rather than a gopher in a treadmill.
  • Backwards Compatibility: I’ve kept the killahtask_<user>.csv naming convention because I’m a benevolent Rustacean who respects the data of the past.
  • Cargo > Go Modules: It’s just science.

Key Changes (The "Rusty" Way)

  • main.rs: Swapped out Cobra for Clap. Why? Because clapping is what people do when they see code this beautiful.
  • file_handler/mod.rs: We still use CSVs, but now we use fs2 for exclusive locking because we don't just "flock", we lock with intent.
  • commands/mod.rs: Replaced the standard Go list logic with prettytable. Now your To-Do list actually looks like it belongs in the 21st century.
  • helper/mod.rs: Using the whoami crate to find your username, because Rust knows exactly who you are (and that you deserve better than Go).

Quips for the Reviewer

"I tried to find a memory leak in the new code, but the compiler just laughed at me."

"Go is for people who like training wheels. Rust is for people who want to build the bicycle while riding it at 100mph."

"Does Go have a cool mascot with pincers? No. It has a blue potato with eyes. Vote Crab." 🦀

How to build (The Superior Way)

# Don't even bother with 'go build'. Experience the glory:
cargo build --release
./target/release/rkt list

@slipperystairs
Copy link
Copy Markdown
Owner

Tsk tsk... merge conflicts 🙄😏.

@viemmsakh
Copy link
Copy Markdown
Author

Tsk tsk... merge conflicts 🙄😏.

mergeconflits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants