{"id":27240622,"url":"https://github.com/davidmcneil/the-rusty-web","last_synced_at":"2025-04-10T19:19:34.769Z","repository":{"id":145419700,"uuid":"81481231","full_name":"davidMcneil/the-rusty-web","owner":"davidMcneil","description":"Targeting the web with Rust.","archived":false,"fork":false,"pushed_at":"2018-12-16T17:10:29.000Z","size":4854,"stargazers_count":126,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-12T10:36:56.817Z","etag":null,"topics":["asmjs","javascript","rust","web","webassembly"],"latest_commit_sha":null,"homepage":"https://davidmcneil.github.io/the-rusty-web/","language":"JavaScript","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/davidMcneil.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}},"created_at":"2017-02-09T18:26:03.000Z","updated_at":"2024-01-04T16:11:18.000Z","dependencies_parsed_at":"2023-06-26T05:46:54.732Z","dependency_job_id":null,"html_url":"https://github.com/davidMcneil/the-rusty-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidMcneil%2Fthe-rusty-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidMcneil%2Fthe-rusty-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidMcneil%2Fthe-rusty-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidMcneil%2Fthe-rusty-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidMcneil","download_url":"https://codeload.github.com/davidMcneil/the-rusty-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281376,"owners_count":21077423,"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":["asmjs","javascript","rust","web","webassembly"],"created_at":"2025-04-10T19:19:34.284Z","updated_at":"2025-04-10T19:19:34.730Z","avatar_url":"https://github.com/davidMcneil.png","language":"JavaScript","readme":"# The Rusty Web\n\n[![Website](https://img.shields.io/badge/website-The_Rusty_Web-red.svg)](https://davidmcneil.github.io/the-rusty-web/)\n[![Guide](https://img.shields.io/badge/guide-GitBook-blue.svg)](https://davidmcneil.gitbooks.io/the-rusty-web/content/)\n\n_Note: The contents of this repo are now significantly outdated. Check out [rustwasm](https://github.com/rustwasm/team) for the latest and greatest on how to integrate Rust ans WebAssembly._\n\nDiscussion on [Hacker News](https://news.ycombinator.com/item?id=13820175).\n\n## About\n\nThis project demonstrates a complete, albeit simple, example of integrating\n[Rust](https://www.rust-lang.org) code into a web application. This is accomplished by compiling\nRust to [asm.js](http://asmjs.org/) or [WebAssembly](http://webassembly.org/). The\nbasic design pattern this project explores uses Rust to implement CPU bound portions of an app while\nusing existing web technologies to handle user facing, I/O bound pieces. The\n[guide](https://davidmcneil.gitbooks.io/the-rusty-web/content/) explores this design pattern in\ndetail.\n\nThe project compares implementations of the\n[k-means clustering](https://en.wikipedia.org/wiki/K-means_clustering) algorithm (this example's\nCPU bound task) applied to an image. The algorithm gives the resulting image a softened, painted look.\n\n## Setup\n\n### Dependencies\n\nSee the [guide](https://davidmcneil.gitbooks.io/the-rusty-web/content/setup-and-hello-world.html)\nfor steps on installing the dependencies.\n\n- [Rust](https://www.rust-lang.org)\n- [Node](https://nodejs.org)\n- [Emscripten](http://emscripten.org)\n\n### Running the Project Natively\n\nFrom the top level of the project run\n\n\u003e cargo run\n\nor\n\n\u003e cargo run --release\n\nThe resulting painted image can be found at _img/out.jpg_.\n\n### Running on the Web\n\nFrom the top level of the project...\n\nBuild the asm.js version\n\n\u003e cargo build --release --target asmjs-unknown-emscripten\n\nBuild the WebAssembly version\n\n\u003e cargo build --release --target wasm32-unknown-emscripten\n\nFrom the _website/_ directory...\n\nInstall node dependencies\n\n\u003e npm install\n\nBuild the website (build results can be found in _website/dist_)\n\n\u003e npm run build\n\nor build the website in release mode\n\n\u003e npm run build-release\n\nor start a web server, website is served at [http://localhost:9000/](http://localhost:9000/)\n\n\u003e npm run start\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmcneil%2Fthe-rusty-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidmcneil%2Fthe-rusty-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidmcneil%2Fthe-rusty-web/lists"}