{"id":20622470,"url":"https://github.com/codewithmirza/dtow","last_synced_at":"2026-05-09T19:10:04.518Z","repository":{"id":254061711,"uuid":"774221426","full_name":"codewithmirza/dtow","owner":"codewithmirza","description":"Compile some C code to WASM and call it from Dart (non-Flutter) web app compiled to WASM.","archived":false,"fork":false,"pushed_at":"2024-04-02T18:07:54.000Z","size":6293,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T09:08:55.492Z","etag":null,"topics":["c","compilation","dart","web-application","webassembly"],"latest_commit_sha":null,"homepage":"https://codewithmirza.github.io/dtow/","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/codewithmirza.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-03-19T06:51:09.000Z","updated_at":"2024-08-21T04:56:25.000Z","dependencies_parsed_at":"2024-08-21T07:04:26.995Z","dependency_job_id":null,"html_url":"https://github.com/codewithmirza/dtow","commit_stats":null,"previous_names":["codewithmirza/dtow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codewithmirza/dtow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fdtow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fdtow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fdtow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fdtow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithmirza","download_url":"https://codeload.github.com/codewithmirza/dtow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmirza%2Fdtow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268401594,"owners_count":24244464,"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-02T02:00:12.353Z","response_time":74,"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":["c","compilation","dart","web-application","webassembly"],"created_at":"2024-11-16T12:23:00.717Z","updated_at":"2026-05-09T19:10:04.461Z","avatar_url":"https://github.com/codewithmirza.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compiled some C code to WASM and called it from Dart (non-Flutter) web app compiled to WASM.\n\nThis project demonstrates the process of compiling C code into WebAssembly (WASM) and calling it from a Dart web application, also compiled to WebAssembly. By leveraging WebAssembly, developers can integrate performance-sensitive C code directly into Dart web applications without the need for server-side processing. \n\n## Project Description\n\nFor this project, we've compiled a small C module using Emscripten to create a WASM module. This module contains a single C function that will be invoked from Dart code. The Dart code utilizes the `dart:ffi` library and `@Native` annotations to import the C function and interact with it. Additionally, the Dart code makes use of the `package:web` library to interact with the DOM for input and output purposes.\n\nThe workflow involves compiling the C code to WASM using Emscripten and the Dart code to WASMGC using the `dart compile wasm` command. This generates `main.dart.mjs` and `main.dart.wasm` files. The `main.dart.mjs` file is used to instantiate and invoke the WebAssembly-compiled Dart program.\n\n## Sample Project Details\n\n### Setup Instructions\n\n1. Compile the C module to WASM:\n   ```\n   emcc my_c_module.c WASM=1 -o my_c_module.wasm\n   ```\n\n2. Compile the Dart code to WASMGC:\n   ```\n   dart compile wasm main.dart\n   ```\n\n\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmirza%2Fdtow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithmirza%2Fdtow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmirza%2Fdtow/lists"}