{"id":18160716,"url":"https://github.com/blankeos/rust-practice","last_synced_at":"2025-07-23T03:05:41.442Z","repository":{"id":246988803,"uuid":"824322979","full_name":"Blankeos/rust-practice","owner":"Blankeos","description":"🦀 Learning Rust because it's cool","archived":false,"fork":false,"pushed_at":"2025-07-19T10:33:27.000Z","size":660,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T15:16:09.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blankeos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-04T21:39:49.000Z","updated_at":"2025-07-19T10:33:30.000Z","dependencies_parsed_at":"2024-07-06T03:19:02.457Z","dependency_job_id":"d2108cc3-61c9-4486-8961-69e98ce1eb3c","html_url":"https://github.com/Blankeos/rust-practice","commit_stats":null,"previous_names":["blankeos/rust-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blankeos/rust-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Frust-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Frust-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Frust-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Frust-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankeos","download_url":"https://codeload.github.com/Blankeos/rust-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Frust-practice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266609038,"owners_count":23955565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-02T08:09:08.843Z","updated_at":"2025-07-23T03:05:41.432Z","avatar_url":"https://github.com/Blankeos.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦀 Rust Practice\n\nLearning Rust because I wanna get into low-level programming and do some cool stuff with it.\n\nThis technically follows the Rust Book coincidentally.\n\nProjects on this repo:\n\n1. [x] Hello World - Rust basics. (Like `node index.js`) - `rustc main.rs \u0026\u0026 ./main`\n2. [x] Hello Cargo - Rust basics + Package Manager + Build Tool. (Like `npm run dev`)\n3. [x] Guessing Game - Random number generate, then take user input until random number is guessed.\n4. [x] Salary - Console app that estimates salary based on hourly, daily, monthly, and yearly rates.\n5. [ ] Tried Passwords CLI - Recreation of my [Go implementation](https://github.com/Blankeos/tried-passwords-cli).\n6. [ ] HTTP Server - Simple HTTP server to understand networking and concurrency in Rust.\n7. [ ] Actix Server - API Server with a framework called Actix (Like Go's Fiber wrapped around HTTP standard libs).\n8. [x] Rspc Server - API Server but typesafe for TypeScript (like tRPC), expect it's in Rust! Very sick.\n9. [ ] TCP Socket Chat - A console-based chat application using sockets to understand network communication.\n10. [ ] Random Quotes - A simple CLI application that fetches a random quote from the [API Ninjas Quotes](https://api-ninjas.com/api/quotes).\n11. [ ] Tic Tac Toe - A simple Tic Tac Toe game with persistence.\n12. [ ] WebSocket Chat - A console-based chat application using WebSockets to understand network communication on browser.\n13. [ ] Static Site Generator - Converts markdown to HTML.\n14. [ ] Tauri - Electron-like webview for Rust.\n15. [x] GPUI_Hello - A simple `gpui` program (Zed's gui library) for practice.\n16. [x] GPUI_Input - A simple input field with `gpui` for practice.\n17. [ ] Todo GUI Application - A simple GUI application to manage tasks.\n\n### Notes\n\n- Install Rust using [rustup](https://doc.rust-lang.org/book/ch01-01-installation.html#installing-rustup-on-linux-or-macos) - The installation and updating process is as convenient as Bun.\n- CLI's you need to know: `rustup` is for installing and updating Rust. While `rustc` is the compiler. `cargo` is the package manager + build tool.\n  - Coming from Bun, that's essentially: `bun`, `bun build`, and `bun install`/`bun run`\n- `cargo new \u003cproject-name\u003e` to create a new project in a file called project-name.\n- `cargo new --lib` to create a project with lib.rs crate.\n- `cargo init` to create a project inside current folder.\n- `cargo build` to build the project or `cargo run` to build and run in one command. Or `cargo build --release` for a release build in `target/release` instead of `target/debug`.\n- `cargo run -q` to run the program without the noise (doesn't remove the WARN though).\n- `cargo check` to see if it compiles or not.\n- `cargo update` updates the dependencies (like `pnpm update -i` I think).\n- `cargo doc --open` opens the docs of all your dependencies in the browser.\n- `cargo add \u003cdep\u003e` add a cargo dep to the project. Or you can also add a snippet into `[dependencies]` of `Cargo.toml` yourself.\n- `cargo install --path .` Installs the binary to your path (It's not like bun install)\n- If you want something that \"installs deps\" like bun install, just run any: `cargo check`, `cargo build`, `cargo run`, or `cargo clippy --all-targets`\n- `cargo install --list` to see what you installed in your path.\n- `cargo clippy --all-targets` - should be your primary feedback loop, can even do this on save.\n\n#### Terminologies\n\n- Crate - module/package. Must have at least 1 crate. I think it's just either a `.rs` file or a \"project\".\n- Binary crate - inside `src/bin/*.rs` - can have 0 or multiple.\n- Library crate - inside `src/lib.rs` - can only have 1.\n- `mod` - that's a module in code. By default it's private. Add `pub` to make it public. `fn` also follows the same rule.\n- `struct` and `impl` - Basically OOP in Rust, but better. Follows the same privacy rules as `mod`\n- `enum` - you already know. Follows the same privacy rules as `mod` as well.\n\n#### Faster Rust feedback loop tips:\n\n- Use `[profile.dev] opt-level = 1` in `Cargo.toml` for faster compile times before making release builds.\n- More:\n\n```toml\n# I got this from Bevy's docs.\n\n# Enable a small amount of optimization in the dev profile.\n[profile.dev]\nopt-level = 1\n\n# Enable a large amount of optimization in the dev profile for dependencies.\n[profile.dev.package.'*']\nopt-level = 3\n```\n\n- Primary feedback loop instead of compile: `cargo clippy --all-targets`. Can do this on save.\n\n### Libraries\n\nLibs that are kinda essential to know\n\n- tokio - async\n- serde - for serializing/deserializing. It's very generic so treat it like a library.\n- serde_json - specifically for JSON serialization/deserialization (not confused anymore ?)\n- clap - for making CLIs\n- bevy - making games\n- wgpu - for programming the GPU (used by Firefox's web gpu)\n- axum - for web apis and web framework stuff\n- embassy - embedded systems\n- rayon - for parallelism (contrasts with tokio for async)\n- nom - for parsing, so you can avoid regex.\n- cargo lambda - make rust bins for aws lambda easy\n- wasm-bindgen - Rust program that can run in web (wasm). (I used this, very nice). + wasm-pack\n- napi-rs - node.js add-ons in rust.\n- polars - df library in rust (doesn't work in wasm). I use rowboat.\n\n### Resources\n\n- [Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html) - Teaches Getting Started to Advanced Rust.\n- [Rust Book but Video Playlist by \"Let's Get Rusty\"](https://www.youtube.com/watch?v=OX9HJsJUDxA\u0026list=PLai5B987bZ9CoVR-QEIN9foz4QCJ0H2Y8\u0026index=2)\n- [Rustlings](https://github.com/rust-lang/rustlings) - Small exercises that can complement the Rust Book.\n- [Rust By Example](https://doc.rust-lang.org/rust-by-example/index.html) - A collection of runnable examples that illustrate various Rust concepts and standard libraries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Frust-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankeos%2Frust-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Frust-practice/lists"}