{"id":51045278,"url":"https://github.com/simolus3/wasm.dart","last_synced_at":"2026-06-22T13:02:13.610Z","repository":{"id":366423836,"uuid":"1261557432","full_name":"simolus3/wasm.dart","owner":"simolus3","description":"Tools to run Dart in any WebAssembly runtime","archived":false,"fork":false,"pushed_at":"2026-06-21T18:52:24.000Z","size":421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-21T20:07:13.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simolus3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-06T21:14:56.000Z","updated_at":"2026-06-21T18:52:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/simolus3/wasm.dart","commit_stats":null,"previous_names":["simolus3/wasm.dart"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/simolus3/wasm.dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fwasm.dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fwasm.dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fwasm.dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fwasm.dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simolus3","download_url":"https://codeload.github.com/simolus3/wasm.dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Fwasm.dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34649822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"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":[],"created_at":"2026-06-22T13:02:12.041Z","updated_at":"2026-06-22T13:02:13.605Z","avatar_url":"https://github.com/simolus3.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart WebAssembly components\n\nTools to compile Dart programs and packages to [WebAssembly components](https://component-model.bytecodealliance.org/),\nallowing them to run as CLI applications, servers and more targets with compatible runtimes.\n\nThe goal is to get `wasmtime run dart_compiled_app.wasm` to work without further setup.\n\n\u003e [!NOTE]\n\u003e These tools are in development and can't handle much more than a hello world program at the moment.\n\n## Approach\n\nVia the experimental `--standalone` mode, Dart can compile to WebAssembly with Dart-specific, documented [host imports](https://github.com/dart-lang/sdk/blob/main/sdk/lib/_internal/wasm/standalone/embedder.dart).\nThe goal of this project is to:\n\n1. Implement these host imports in WebAssembly, and link their definition into compiled Dart apps to remove the host import.\n2. Track metadata around the compilation to lift `dart2wasm` modules into WebAssembly components.\n\nWherever reasonable, we want to write the WebAssembly implementation for step 1 in Dart. We do this by annotating methods with `@pragma('wasm:export')` and\nthen use a post-compilation link step that resolves imports against these definitions of the same module.\n\nThe main packages in this repository are:\n\n1. `wasm_tools`: CLI tools to generate wit bindings from Dart and to compile Dart to components.\n2. `wasm_components`: Dart runtime for the component model.\n\n## Demo\n\nGo to `examples/hello_world_custom`, run `dart run wasm_tools compile bin/app.dart`. This compiles\n`bin/app.dart` to `bin/app.wasm`.\n\nRun `cargo run` to run this app with Wasmtime.\n\n## Status\n\nThis is a [full list of host imports](https://github.com/dart-lang/sdk/blob/main/sdk/lib/_internal/wasm/standalone/embedder.dart) we need to implement.\n\n__Legend__:\n\n- 🎯: This can reasonably be implemented in Dart/WebAssembly without host imports.\n- 📦: This requires a host import (a WASI proposal).\n- 🛑: This is fundamentally unavailable and we can only provide stub imports.\n\n| Method                                   | Implemented | Category | Notes                         |\n|------------------------------------------|-------------|----------|-------------------------------|\n| scheduleOnce                             |             | 📦        |                               |\n| scheduleRepeated                         |             | 📦        |                               |\n| queueMicrotask                           |             | 🎯        |                               |\n| clearSchedule                            |             | 📦        |                               |\n| currentTimeMicros                        |             | 📦        |                               |\n| stringFromCharCodeArray                  |             | 🎯        |                               |\n| stringFromAsciiBytes                     | ✅          | 🎯        |                               |\n| stringLength                             | ✅          | 🎯        |                               |\n| stringEquals                             |             | 🎯        |                               |\n| stringCompare                            |             | 🎯        |                               |\n| stringCodeUnitAt                         | ✅          | 🎯        |                               |\n| stringIndexOfString                      |             | 🎯        |                               |\n| stringLastIndexOfString                  |             | 🎯        |                               |\n| stringReplaceAllString                   |             | 🎯        |                               |\n| stringReplaceAllRegExp                   |             | 🎯        |                               |\n| stringSubstring                          |             | 🎯        |                               |\n| stringToLowerCase                        |             | 🎯        |                               |\n| stringToUpperCase                        |             | 🎯        |                               |\n| stringConcat                             |             | 🎯        |                               |\n| stringRepeat                             |             | 🎯        |                               |\n| stringReplaceRange                       |             | 🎯        |                               |\n| stringToCodeUnits                        |             | 🎯        |                               |\n| monotonicClockFrequency                  |             | 📦        |                               |\n| monotonicClockTicks                      |             | 📦        |                               |\n| weakRefCreate                            |             | 🛑        |                               |\n| weakRefGet                               |             | 🛑        |                               |\n| expandoCreate                            |             | 🛑        |                               |\n| expandoGet                               |             | 🛑        |                               |\n| expandoSet                               |             | 🛑        |                               |\n| finalizerCreate                          |             | 🛑        |                               |\n| finalizerAttach                          |             | 🛑        |                               |\n| finalizerDetach                          |             | 🛑        |                               |\n| baseUri                                  |             | 📦        |                               |\n| isWindows                                |             | 📦        |                               |\n| stackTraceGetCurrent                     | ✅          | 🛑        | Impossible, stub used         |\n| stackTraceToString                       | ✅          | 🛑        | Impossible, stub used         |\n| doubleTryParse                           |             | 🎯        |                               |\n| tryParseResultGetDouble                  |             | 🎯        |                               |\n| doubleParseInfallible                    |             | 🎯        |                               |\n| i64ToString                              | ✅          | 🎯        | Needs optimization for base10 |\n| f64ToExponential                         |             | 🎯        |                               |\n| f64ToExponentialWithFractionDigits       |             | 🎯        |                               |\n| f64ToPrecision                           |             | 🎯        |                               |\n| f64ToFixed                               |             | 🎯        |                               |\n| f64ToString                              |             | 🎯        | Currently a stub              |\n| stringBufferCreate                       | ✅          | 🎯        |                               |\n| stringBufferWriteString                  | ✅          | 🎯        |                               |\n| stringBufferWriteCharCode                | ✅          | 🎯        |                               |\n| stringBufferClear                        | ✅          | 🎯        |                               |\n| stringBufferLength                       | ✅          | 🎯        |                               |\n| stringBufferToString                     | ✅          | 🎯        |                               |\n| regexpCreateOrFailWithString             |             | 🎯        | See [what Kotlin does](https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib/native-wasm/src/kotlin/text/regex)          |\n| regexpIsRegexp                           |             | 🎯        |                               |\n| regexpEscape                             |             | 🎯        |                               |\n| regexpMatch                              |             | 🎯        |                               |\n| regexpMatchGetStart                      |             | 🎯        |                               |\n| regexpMatchGetEnd                        |             | 🎯        |                               |\n| regexpMatchGetGroupCount                 |             | 🎯        |                               |\n| regexpMatchGetGroup                      |             | 🎯        |                               |\n| regexpMatchGetNamedGroups                |             | 🎯        |                               |\n| regexpMatchGetGroupName                  |             | 🎯        |                               |\n| regexpMatchGetGroupByName                |             | 🎯        |                               |\n| timeZoneNameForClampedSeconds            |             | 📦        |                               |\n| timeZoneOffsetInSecondsForClampedSeconds |             | 📦        |                               |\n| mathPow                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathAtan2                                | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathSin                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathCos                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathTan                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathAcos                                 | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathAsin                                 | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathAtan                                 | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathExp                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| mathLog                                  | ✅          | 🎯        | Using `libm` in Rust.         |\n| randomInt                                |             | 📦        |                               |\n| randomIntSecure                          |             | 📦        |                               |\n| print                                    |             | 📦        | Currently a stub              |\n| jsonEncodeString                         |             | 🎯        | Currently a stub              |\n| debugger                                 |             | 🛑        |                               |\n| inspect                                  |             | 🛑        |                               |\n| dartTimelineStreamEnabled                |             | 🛑        |                               |\n| reportTaskEvent                          |             | 🛑        |                               |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Fwasm.dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimolus3%2Fwasm.dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Fwasm.dart/lists"}