{"id":28956662,"url":"https://github.com/nimaoth/nimwasmtime","last_synced_at":"2025-06-23T21:40:30.886Z","repository":{"id":248317091,"uuid":"828363212","full_name":"Nimaoth/nimwasmtime","owner":"Nimaoth","description":"Nim wrapper for wasmtime","archived":false,"fork":false,"pushed_at":"2025-06-23T19:17:00.000Z","size":854,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T20:25:44.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nim","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/Nimaoth.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}},"created_at":"2024-07-13T23:01:51.000Z","updated_at":"2025-06-23T19:17:05.000Z","dependencies_parsed_at":"2024-11-01T00:21:43.028Z","dependency_job_id":"e35b8989-cce7-4084-b0ee-bea9987ccaa2","html_url":"https://github.com/Nimaoth/nimwasmtime","commit_stats":null,"previous_names":["nimaoth/nimwasmtime"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nimaoth/nimwasmtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nimaoth%2Fnimwasmtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nimaoth%2Fnimwasmtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nimaoth%2Fnimwasmtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nimaoth%2Fnimwasmtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nimaoth","download_url":"https://codeload.github.com/Nimaoth/nimwasmtime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nimaoth%2Fnimwasmtime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561176,"owners_count":23177543,"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":[],"created_at":"2025-06-23T21:40:29.831Z","updated_at":"2025-06-23T21:40:30.864Z","avatar_url":"https://github.com/Nimaoth.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nimwasmtime\n\nNim wrapper for wasmtime\n\nThis wrapper is auto-generated with [Futhark](https://github.com/PMunch/futhark), but also tries to add some nicer wrappers\naround some functions.\n\n## Installation\n\nAdd this to your nimble file:\n\n```nim\nrequires \"https://github.com/Nimaoth/nimwasmtime \u003e= 0.1.9\"\n```\n\n## Usage\n\nSee [here](tests/test2.nim) for more examples.\n\n```nim\nimport std/[strformat, options]\nimport wasmtime\n\nproc main() =\n  let config = newConfig()\n  let engine = newEngine(config)\n\n  let linker = engine.newLinker()\n  defer: linker.delete()\n\n  let store = engine.newStore(nil, nil)\n  defer: store.delete()\n\n  let context = store.context()\n\n  let wasiConfig = newWasiConfig()\n\n  wasiConfig.inheritStdin()\n  wasiConfig.inheritStderr()\n  wasiConfig.inheritStdout()\n  context.setWasi(wasiConfig).toResult(void).okOr(err):\n    echo \"Failed to setup wasi: \", err.msg\n    return\n\n  let wasmBytes = readFile(\"tests/wasm/testm.wasm\")\n  let module = engine.newModule(wasmBytes).okOr(err):\n    echo \"Failed to load wasm module: \", err.msg\n    return\n\n  linker.defineWasi().okOr(err):\n    echo \"Failed to create linker: \", err.msg\n    return\n\n  var trap: ptr WasmTrapT = nil\n  let instance = linker.instantiate(context, module, trap.addr).okOr(err):\n    echo \"Failed to instantiate wasm module: \", err.msg\n    return\n\n  trap.okOr(err):\n    echo \"[trap] Failed to instantiate wasm module: \", err.msg\n    return\n\n  let mainExport = instance.getExport(context, \"hello\")\n  mainExport.get.of_field.func_field.addr.call(context, [], [], trap.addr).toResult(void).okOr(err):\n    echo \"Failed to call hello: \", err.msg\n    return\n\nmain()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimaoth%2Fnimwasmtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimaoth%2Fnimwasmtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimaoth%2Fnimwasmtime/lists"}