{"id":29966710,"url":"https://github.com/comamoca/subaru","last_synced_at":"2025-08-04T03:03:41.085Z","repository":{"id":301361649,"uuid":"1008977913","full_name":"Comamoca/subaru","owner":"Comamoca","description":"A Gleam WASM runner that allows executing Gleam code dynamically using WebAssembly.","archived":false,"fork":false,"pushed_at":"2025-06-27T03:08:12.000Z","size":140,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T09:50:08.188Z","etag":null,"topics":["cli","deno","gleam-lang"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comamoca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2025-06-26T11:39:05.000Z","updated_at":"2025-07-02T16:47:40.000Z","dependencies_parsed_at":"2025-06-26T13:41:57.821Z","dependency_job_id":"8a8bda9b-1c43-48e4-b12c-1683a1a2dc7e","html_url":"https://github.com/Comamoca/subaru","commit_stats":null,"previous_names":["comamoca/subaru"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Comamoca/subaru","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fsubaru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fsubaru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fsubaru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fsubaru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comamoca","download_url":"https://codeload.github.com/Comamoca/subaru/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comamoca%2Fsubaru/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268643761,"owners_count":24283318,"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-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["cli","deno","gleam-lang"],"created_at":"2025-08-04T03:01:19.322Z","updated_at":"2025-08-04T03:03:41.070Z","avatar_url":"https://github.com/Comamoca.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Last commit](https://img.shields.io/github/last-commit/Comamoca/subaru?style=flat-square)\n![Repository Stars](https://img.shields.io/github/stars/Comamoca/subaru?style=flat-square)\n![Issues](https://img.shields.io/github/issues/Comamoca/subaru?style=flat-square)\n![Open Issues](https://img.shields.io/github/issues-raw/Comamoca/subaru?style=flat-square)\n![Bug Issues](https://img.shields.io/github/issues/Comamoca/subaru/bug?style=flat-square)\n\n\u003cimg src=\"https://emoji2svg.deno.dev/api/✨️\" alt=\"eyecatch\" height=\"100\"\u003e\n\n# subaru\n\nA Gleam WASM runner that allows executing Gleam code dynamically using WebAssembly.\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./assets/quote.jpg\" alt=\"Quote\" width=\"50%\"\u003e\n\n\u003c/div\u003e\n\n## 🚀 How to use\n\n```sh\n# Using installed version (after deno install)\nsubaru example.gleam\nsubaru --code 'import gleam/io\npub fn main() { io.println(\"Hello from WASM!\") }'\n\n# Using direct URL execution\ndeno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts example.gleam\n\n# Using local development version\ndeno task cli example.gleam\ndeno task cli --code 'import gleam/io\npub fn main() { io.println(\"Hello from WASM!\") }'\n\n# Execute remote script\nsubaru --url https://example.com/script.gleam\n```\n\n- Execute Gleam files directly without compilation\n- Run Gleam code from strings, files, or remote URLs\n- Dynamic compilation using Gleam's WebAssembly compiler\n- Worker-based execution for safe code isolation\n- Configurable logging and debug output\n- **Preloaded Standard Libraries** - Automatic access to essential Gleam modules\n- **Echo Keyword Support** - Full support for Gleam v1.11.0's debugging features\n\n## ⬇️ Install\n\n### Prerequisites\n\n- [Deno](https://deno.land/) - Modern runtime for JavaScript and TypeScript\n- [Gleam](https://gleam.run/) - For local Gleam development (optional)\n\n### Using deno install (Recommended)\n\n```sh\n# Install globally\ndeno install --allow-all -n subaru https://github.com/Comamoca/subaru/raw/main/src/cli.ts\n\n# Run from anywhere\nsubaru --help\nsubaru example.gleam\nsubaru --code 'import gleam/io\npub fn main() { io.println(\"Hello!\") }'\n```\n\n### Direct URL execution\n\n```sh\n# Run directly from GitHub without installation\ndeno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts --help\n\n# Execute Gleam code\ndeno run --allow-all https://github.com/Comamoca/subaru/raw/main/src/cli.ts --code 'import gleam/io\npub fn main() { io.println(\"Hello from URL!\") }'\n```\n\n### From GitHub (Local Development)\n\n```sh\n# Clone repository\ngit clone https://github.com/Comamoca/subaru\ncd subaru\n\n# Setup (download Gleam WASM compiler)\ndeno task setup\n\n# Run CLI\ndeno task cli --help\n```\n\n### From Source\n\n```sh\ngit clone https://github.com/Comamoca/subaru\ncd subaru\ndeno task setup\n```\n\n## ⛏️ Development\n\n```sh\n# Using Nix (recommended)\nnix develop\n\n# Or with direnv\ndirenv allow\n\n# Manual setup\ndeno task setup\n\n# Development commands\ndeno task dev        # Setup and run development environment\ndeno task test       # Run all tests\ndeno task example    # Run usage examples\ndeno task fmt        # Format code\ndeno task lint       # Lint code\ndeno task check      # Type check\n```\n\n### Preloaded Libraries Usage Example\n\nAll these libraries are automatically available without imports:\n\n```gleam\nimport gleam/io\nimport gleam/list\nimport gleam/string\nimport gleam/int\nimport gleam/result\n\npub fn main() {\n  // List operations\n  [1, 2, 3, 4, 5]\n  |\u003e list.map(fn(x) { x * 2 })\n  |\u003e echo  // [2, 4, 6, 8, 10]\n  |\u003e list.filter(fn(x) { x \u003e 5 })\n  |\u003e echo  // [6, 8, 10]\n  \n  // String operations\n  \"Hello, Gleam!\"\n  |\u003e string.uppercase()\n  |\u003e io.println()  // HELLO, GLEAM!\n  \n  // Result operations\n  let result = case int.parse(\"42\") {\n    Ok(num) -\u003e \"Parsed: \" \u003c\u003e int.to_string(num)\n    Error(_) -\u003e \"Parse failed\"\n  }\n  io.println(result)  // Parsed: 42\n}\n```\n\n## 📝 Todo\n\n- [ ] Add more comprehensive error handling\n- [ ] Implement module caching for better performance\n- [ ] Add support for custom Gleam compiler versions\n- [ ] Create VSCode extension for Gleam WASM execution\n- [ ] Add streaming execution for large outputs\n- [ ] Implement code completion and syntax highlighting\n- [ ] Add benchmark suite for performance testing\n- [ ] Support for additional output formats (JSON, XML, etc.)\n\n## 📜 License\n\nMIT License - see [LICENSE](./LICENSE.md) file for details.\n\nThis project is open source and available under the MIT License.\n\n### 🧩 Modules\n\n#### TypeScript/Deno Dependencies\n\n- **Deno Standard Library** - File system, path utilities, testing\n- **Gleam WASM Compiler** - Dynamic Gleam compilation to JavaScript\n\n#### Preloaded Gleam Libraries\n\n- [gleam_stdlib](https://hexdocs.pm/gleam_stdlib/)\n- [gleam_javascript](https://hexdocs.pm/gleam_javascript/index.html)\n\n#### Development Environment\n\n- **Nix Flakes** - Reproducible development environment management\n- **devenv** - Development shell configuration and tooling\n- **pre-commit hooks** - Security scanning (git-secrets, ripsecrets)\n- **treefmt** - Automated code formatting across languages\n\n## 👏 Affected projects\n\n- [Gleam Language](https://gleam.run/) - Functional language for building type-safe systems that inspired this project\n- [Deno](https://deno.land/) - Modern runtime that enabled TypeScript-first development\n- [WebAssembly](https://webassembly.org/) - Binary instruction format that makes dynamic compilation possible\n\n## 💕 Special Thanks\n\n- **Gleam Team** - For creating an amazing functional language with excellent WASM support\n- **Deno Team** - For providing a fantastic development experience with TypeScript\n- **WebAssembly Community** - For enabling dynamic compilation and safe execution in browsers\n- **Nix Community** - For reproducible development environments and excellent tooling\n- **Open Source Contributors** - For all the libraries and tools that made this project possible\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomamoca%2Fsubaru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomamoca%2Fsubaru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomamoca%2Fsubaru/lists"}