{"id":13932918,"url":"https://github.com/mohanson/pywasm","last_synced_at":"2025-05-15T00:07:57.324Z","repository":{"id":48956236,"uuid":"161721028","full_name":"mohanson/pywasm","owner":"mohanson","description":"A WebAssembly interpreter written in pure Python","archived":false,"fork":false,"pushed_at":"2025-05-08T00:49:26.000Z","size":2054,"stargazers_count":473,"open_issues_count":0,"forks_count":39,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-08T01:34:33.510Z","etag":null,"topics":["webassembly"],"latest_commit_sha":null,"homepage":"","language":"WebAssembly","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/mohanson.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}},"created_at":"2018-12-14T02:27:41.000Z","updated_at":"2025-05-08T00:49:31.000Z","dependencies_parsed_at":"2025-02-28T14:08:57.196Z","dependency_job_id":"eac68409-75b3-489f-bb71-6dc97d2d2bf1","html_url":"https://github.com/mohanson/pywasm","commit_stats":{"total_commits":117,"total_committers":6,"mean_commits":19.5,"dds":0.07692307692307687,"last_synced_commit":"c6a7e6ca1d2df784035ec6f84ad9046cd87de4de"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanson%2Fpywasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanson%2Fpywasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanson%2Fpywasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanson%2Fpywasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohanson","download_url":"https://codeload.github.com/mohanson/pywasm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249198,"owners_count":22039029,"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":["webassembly"],"created_at":"2024-08-07T21:01:21.689Z","updated_at":"2025-05-15T00:07:52.288Z","avatar_url":"https://github.com/mohanson.png","language":"WebAssembly","readme":"# Pywasm: A WebAssembly interpreter written in pure Python.\n\nA WebAssembly interpreter written in pure Python, no third-party libraries are used.\n\nThe wasm version currently in use is: [WebAssembly Specification, Release 2.0 (Draft 2024-12-18)](https://webassembly.github.io/spec/core/).\n\nAlso requires Python version \u003e= 3.12.\n\n# Installation\n\n```sh\n$ pip install pywasm\n```\n\n# Some simple examples\n\n1. First we need a wasm module! Grab our `./examples/fib.wasm` file and save a copy in a new directory on your local machine. Note: `fib.wasm` was compiled from `./examples/fib.c`.\n\n2. Now, instantiate WebAssembly modules directly from underlying sources. This is achieved using the `Runtime.instance_from_file` method.\n\n```py\nimport pywasm\npywasm.log.lvl = 1\n\nruntime = pywasm.core.Runtime()\nm = runtime.instance_from_file('./examples/fib.wasm')\nr = runtime.invocate(m, 'fib', [10])\nprint(f'fib(10) = {r[0]}')\n```\n\nA brief description for `./examples`\n\n| File                | Description                                  |\n|---------------------|----------------------------------------------|\n| ./examples/add.wasm | Export i32.add function                      |\n| ./examples/env.wasm | Call python/native function in wasm          |\n| ./examples/fib.wasm | Fibonacci, which contains loop and recursion |\n| ./examples/str.wasm | Export a function which returns string       |\n| ./examples/sum.wasm | Equal difference series summation            |\n\n# Test\n\n```sh\n$ python ./test/test_spec.py\n```\n\n# Thanks\n\n- [wagon](https://github.com/go-interpreter/wagon)\n- [warpy](https://github.com/kanaka/warpy)\n- [zstdpy](https://github.com/dholth/zstdpy)\n\n# License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":["Non-Web Embeddings","Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohanson%2Fpywasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohanson%2Fpywasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohanson%2Fpywasm/lists"}