{"id":26023892,"url":"https://github.com/neri/wami","last_synced_at":"2025-03-06T11:50:40.502Z","repository":{"id":214725354,"uuid":"734040766","full_name":"neri/wami","owner":"neri","description":"A WebAssembly Interpreter used in my os","archived":false,"fork":false,"pushed_at":"2024-08-22T17:58:53.000Z","size":785,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"canary","last_synced_at":"2024-08-22T20:09:42.908Z","etag":null,"topics":["rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://github.com/neri/maystorm","language":"Rust","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/neri.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":"2023-12-20T18:06:23.000Z","updated_at":"2024-08-22T17:58:57.000Z","dependencies_parsed_at":"2024-02-19T12:44:36.738Z","dependency_job_id":"80d0289d-eed5-40f6-858e-73a1a48892ec","html_url":"https://github.com/neri/wami","commit_stats":null,"previous_names":["neri/wami"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neri%2Fwami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neri%2Fwami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neri%2Fwami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neri%2Fwami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neri","download_url":"https://codeload.github.com/neri/wami/tar.gz/refs/heads/canary","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242206006,"owners_count":20089252,"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":["rust","wasm","webassembly"],"created_at":"2025-03-06T11:50:40.025Z","updated_at":"2025-03-06T11:50:40.489Z","avatar_url":"https://github.com/neri.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WAMI\n\nA WebAssembly Interpreter used in my os (https://github.com/neri/maystorm)\n\n## Features\n\n- Support for `no_std`\n- A subset of WebAssembly 2.0\n- This library by itself does not support execution environments such as WASI.\n\n## Supported WebAssembly 2.0 Features\n\n|Proposals|Status|\n|-|-|\n|Sign extension instructions|✅|\n|Non-trapping float-to-int conversions|✅|\n|Multiple values|-|\n|Reference types|-|\n|Table instructions|-|\n|Multiple tables|-|\n|Bulk memory and table instructions|`memory.fill`, `memory.copy`|\n|Vector instructions|-|\n\n## Requirements\n\n- Rust nightly\n\n## Test\n\n```\n# cargo test\n```\n\n## Example of use\n\n* The actual sample can be found in `/example/hello`.\n* First there is WebAssembly like this.\n\n```wat\n(module\n  (import \"env\" \"println\" (func $println (param i32) (param i32)))\n\n  (memory 1)\n\n  (data (i32.const 16) \"hello world!\")\n\n  (func $main (export \"main\")\n    i32.const 12\n    i32.const 16\n    call $println\n  )\n)\n```\n\n* To run this, we create the following Rust code.\n\n```rust\nuse wa_asm::WasmAssembler;\nuse wami::prelude::*;\n\nfn main() {\n    let src = r#\"\n(module\n  (import \"env\" \"println\" (func $println (param i32) (param i32)))\n\n  (memory 1)\n\n  (data (i32.const 16) \"hello world!\")\n\n  (func $main (export \"main\")\n    i32.const 12\n    i32.const 16\n    call $println\n  )\n)\n\"#;\n    let bin = WebAssembly::wat2wasm(\"hello.wat\", src.as_bytes().to_vec()).unwrap();\n    let instance = WebAssembly::instantiate(\u0026bin, \u0026Env {}).unwrap();\n    instance.exports().main().unwrap();\n}\n\nstruct Env;\n\n#[wasm_env]\nimpl Env {\n    pub fn println(s: \u0026str) {\n        println!(\"{}\", s)\n    }\n}\n\n#[wasm_exports]\ntrait Hello {\n    fn main();\n}\n```\n\n## License\n\nMIT License\n\n(C) 2020 Nerry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneri%2Fwami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneri%2Fwami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneri%2Fwami/lists"}