{"id":46392242,"url":"https://github.com/mrubyedge/playground","last_synced_at":"2026-03-05T09:07:50.017Z","repository":{"id":337260742,"uuid":"1152895539","full_name":"mrubyedge/playground","owner":"mrubyedge","description":"mruby/edge playground on browser","archived":false,"fork":false,"pushed_at":"2026-02-27T11:41:58.000Z","size":4520,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-27T16:39:23.329Z","etag":null,"topics":["mruby","wasm"],"latest_commit_sha":null,"homepage":"https://mrubyedge.github.io/playground/","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/mrubyedge.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-08T15:51:20.000Z","updated_at":"2026-02-27T11:42:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mrubyedge/playground","commit_stats":null,"previous_names":["mrubyedge/playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrubyedge/playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fplayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fplayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fplayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fplayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrubyedge","download_url":"https://codeload.github.com/mrubyedge/playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fplayground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mruby","wasm"],"created_at":"2026-03-05T09:07:49.466Z","updated_at":"2026-03-05T09:07:49.983Z","avatar_url":"https://github.com/mrubyedge.png","language":"Rust","readme":"# mruby/edge Playground\n\nAn interactive mruby playground that runs entirely in your browser using WebAssembly.\n\n## Features\n\n- 💻 Write and execute mruby code in the browser\n- 🎨 Beautiful console-style interface\n- 🚀 Powered by mruby/edge and Emscripten\n- 📦 No server required - runs completely client-side\n\n## Requirements\n\n- Rust (rustup)\n- Emscripten toolchain\n\n## Setup\n\n### 1. Add Emscripten Target\n\n```bash\nrustup target add wasm32-unknown-emscripten\n```\n\n### 2. Install Emscripten SDK\n\n```bash\n# Clone Emscripten SDK\ngit clone https://github.com/emscripten-core/emsdk.git\ncd emsdk\n\n# Install latest version\n./emsdk install latest\n./emsdk activate latest\n\n# Set environment variables (run for each session)\nsource ./emsdk_env.sh\n```\n\n## Build Instructions\n\nBuild options are configured in `.cargo/config.toml`, so you can build with the following command:\n\n```bash\ncargo build --target wasm32-unknown-emscripten --release\n```\n\nThis will generate the following files in the `docs/` directory:\n- `docs/playground.js` - JS glue code generated by Emscripten\n- `docs/playground.wasm` - Compiled WebAssembly binary\n\n## Running Locally\n\n### Start Local Server\n\n```bash\n# Using Python\ncd docs\npython3 -m http.server 8000\n\n# Or using npm serve\nnpx serve docs\n```\n\n### Open in Browser\n\nAccess http://localhost:8000 to use the playground.\nArchitecture\n\n`src/main.rs` exports functions that can be called from JavaScript:\n\n1. **load_ruby_script**: Compiles and executes mruby code, returns the result\n2. **systemMessage**: JavaScript callback for system messages (defined in `library.js`)\n\nThe playground uses Emscripten's `Module` interface to bridge Rust and JavaScript.\n\n1. Push your changes including the `docs/` directory\n2. Go to your repository Settings → Pages\n3. Set Source to \"Deploy from a branch\"\n4. Select branch: `main` (or your default branch)\n5. Select folder: `/docs`\n6. Save and wait for deployment\n\nThe playground will be available at `https://\u003cusername\u003e.github.io/\u003crepository\u003e/`\n\n## Code Explanation\n\n`src/main.rs` outputs messages to the console in two ways:\n\n1. **println! macro**: Emscripten automatically redirects to console.log\n2. **emscripten_run_script**: Directly executes JavaScript code\n\n## Troubleshooting\n\n### CORS Errors\n\nOpening files directly with the `file://` protocol will cause CORS errors. Always use a local HTTP server.\n\n### Build Errors\n\nMake sure Emscripten environment variables are properly set:\n\n```bash\nsource /path/to/emsdk/emsdk_env.sh\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrubyedge%2Fplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrubyedge%2Fplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrubyedge%2Fplayground/lists"}