{"id":22353715,"url":"https://github.com/corrode/rustlab2024","last_synced_at":"2025-07-30T08:34:26.706Z","repository":{"id":264896930,"uuid":"875987222","full_name":"corrode/rustlab2024","owner":"corrode","description":"Write yourself a shell in Rust. A 3-hour course to learn about intermediate Rust concepts and idiomatic code.","archived":false,"fork":false,"pushed_at":"2024-11-09T06:57:21.000Z","size":1257,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-26T17:52:47.804Z","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/corrode.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}},"created_at":"2024-10-21T08:01:53.000Z","updated_at":"2024-11-13T08:42:07.000Z","dependencies_parsed_at":"2024-11-26T17:52:51.497Z","dependency_job_id":"8a5e0368-ce63-496f-abec-55de71c2bfdc","html_url":"https://github.com/corrode/rustlab2024","commit_stats":null,"previous_names":["corrode/rustlab2024"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corrode%2Frustlab2024","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corrode%2Frustlab2024/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corrode%2Frustlab2024/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corrode%2Frustlab2024/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corrode","download_url":"https://codeload.github.com/corrode/rustlab2024/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228114885,"owners_count":17871742,"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","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-12-04T13:09:33.180Z","updated_at":"2024-12-04T13:09:33.728Z","avatar_url":"https://github.com/corrode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Write Yourself A Shell in Rust\n\n![Course banner](assets/banner.png)\n\n## Introduction\n\nOne of the things developers use every day is a [shell](https://multicians.org/shell.html). It comes in many flavors like `bash`, `fish` or `zsh`. Depending on your background, writing your own shell from scratch might either sound intimidating or pointless. We like to believe that it can be a fun way to gain more hands-on Rust experience. If you want to play with concepts like I/O, error handling, and syscalls we invite you to participate in this workshop. Who knows, it could also be an opportunity to start your first mid-size Rust project?\n\n\u003e [!NOTE]\n\u003e Shells are very complex and we will only implement a basic subset of their functionality.\n\u003e Take this workshop as an excuse to learn Rust rather than a guide for how to write the perfect shell.\n\n## Who's the Target Audience?\n\nThis workshop is intended for *intermediate* Rust programmers who already understand basic Rust concepts and have some programming experience. We’ll explain the rest as we go along.\nWhen we were learning Rust, we always wanted to see a mid-size system being built to get an understanding of how the concepts are put into practice. We think this could be a learning boost for people who are in the same situation as we were.\n\n### Necessary Tools\n\n* [rust](https://www.rust-lang.org/tools/install)\n* [git](https://git-scm.com/)\n\n\u003e [!TIP]\n\u003e Please, disable AI code completions in your IDE.\n\u003e This workshop should be a learning experience and since this repository\n\u003e contains the solution, AI code completions will spoil the fun.\n\n## Structure\n\nUse the [slides](./slides.pdf) to go through the exercises.\n\nUse `src/main.rs` to start writing your code.\nIf you get stuck, check out the [examples](/examples) folder, which contains working source code for each block.\nWe recommend to try it yourself first and only refer to the example code in case you run into issues.\n\n## Run tests\n\nYou can find tests for each block in the `tests` folder.\nBy default, tests run the example code for each block.\nWhen you are ready to test your own implementation,\ncomment the `.example()` call in the test and run `cargo test blockN`\n(e.g. `cargo test block1`).\n\n## Blocks\n\nHere are the individual blocks of work that we will cover:\n\n* Block 0 - Check Rust Installation and Version\n* Block 1 - Running Single Commands\n* Block 2 - Concatenating Commands\n* Block 3 - Shell Builtins. E.g. `cd`.\n* Block 4 - Shell History Support\n* Block 5 - Pipes\n* Block 6 - Bring your own features!\n\n\u003e [!TIP]\n\u003e Ideas for extending your shell in block 6:\n\u003e - handling control signals (\u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003ec\u003c/kbd\u003e, \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003ed\u003c/kbd\u003e)\n\u003e - redirection\n\u003e - command completion\n\u003e - adding more builtins\n\u003e - use a grammar for parsing\n\u003e - Hints for the workshop\n\n## Show And Tell!\n\nWe are curious to see what you have built. If you want to share your shell with\nus, please send us a link to your repository. We will add it to the list below.\n\nWe'd be happy to hear your answers to the following questions:\n\n- What did you learn?\n- What was easy?\n- What was hard?\n- Would you do anything differently?\n- What would you like to learn next?\n\n## Closing Words\n\nIf you enjoyed this workshop, please share it with your friends and colleagues.\nIt would greatly help us if you could tweet/toot about it or share it on\n[Reddit](https://www.reddit.com/r/rust/) or [LinkedIn](https://www.linkedin.com/).\nThanks!\n\nYou might also want to [subscribe to our newsletter](https://corrode.dev/blog/) for\nfuture workshops and other Rust content.\n\nIf you are looking for professional Rust training, please get in touch with us\nat [corrode.dev](https://corrode.dev/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrode%2Frustlab2024","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorrode%2Frustlab2024","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrode%2Frustlab2024/lists"}