{"id":25959819,"url":"https://github.com/kawamuray/wasmtime-java","last_synced_at":"2025-03-04T18:48:38.257Z","repository":{"id":37841386,"uuid":"281999579","full_name":"kawamuray/wasmtime-java","owner":"kawamuray","description":"Java or JVM-language binding for Wasmtime","archived":false,"fork":false,"pushed_at":"2023-10-07T06:27:30.000Z","size":343,"stargazers_count":129,"open_issues_count":18,"forks_count":29,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-14T20:58:34.639Z","etag":null,"topics":["java","wasm","wasmtime","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kawamuray.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}},"created_at":"2020-07-23T16:15:17.000Z","updated_at":"2024-11-11T05:42:40.000Z","dependencies_parsed_at":"2023-01-31T08:45:48.525Z","dependency_job_id":null,"html_url":"https://github.com/kawamuray/wasmtime-java","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamuray%2Fwasmtime-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamuray%2Fwasmtime-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamuray%2Fwasmtime-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamuray%2Fwasmtime-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kawamuray","download_url":"https://codeload.github.com/kawamuray/wasmtime-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241904718,"owners_count":20040021,"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":["java","wasm","wasmtime","webassembly"],"created_at":"2025-03-04T18:48:37.596Z","updated_at":"2025-03-04T18:48:38.225Z","avatar_url":"https://github.com/kawamuray.png","language":"Java","readme":"wasmtime-java\n=============\n\nJava (or any JVM) language binding for [Wasmtime](https://github.com/bytecodealliance/wasmtime).\n\nSome basic examples are working, but many API implementations are work in progress.\n\n# Declaring Dependencies\n\nGradle example:\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"io.github.kawamuray.wasmtime:wasmtime-java:$LATEST_VERSION\"\n}\n```\n\nAn artifact (JAR) of `wasmtime-java` ships along with prebuilt JNI libraries for some major platforms, so just adding the above dependency provides you a self-contained `wasmtime` runtime on supported platforms:\n\n| OS          | Arch    |\n| ----        | ----    |\n| Linux (ELF) | x86_64  |\n| Mac OS      | x86_64  |\n| Mac OS      | aarch64 |\n| Windows     | x86_64  |\n\n# Example\n\nSee [examples](./examples) for the full example.\n\n```java\npublic class HelloWasm {\n    public static void main(String[] args) {\n        try (Store\u003cVoid\u003e store = Store.withoutData();\n             Engine engine = store.engine();\n             Module module = Module.fromFile(engine, \"./hello.wat\");\n             Func helloFunc = WasmFunctions.wrap(store, () -\u003e {\n                 System.err.println(\"\u003e\u003e\u003e Calling back...\");\n                 System.err.println(\"\u003e\u003e\u003e Hello World!\");\n             })) {\n            Collection\u003cExtern\u003e imports = Arrays.asList(Extern.fromFunc(helloFunc));\n            try (Instance instance = new Instance(store, module, imports)) {\n                try (Func f = instance.getFunc(\"run\").get()) {\n                    WasmFunctions.Consumer0 fn = WasmFunctions.consumer(f);\n                    fn.accept();\n                }\n            }\n        }\n    }\n}\n```\n\nRun example:\n```sh\n$ ./gradlew -Pmain=examples.HelloWorld examples:run\n```\n\n# How to build\n\n```sh\n$ ./gradlew build\n```\n\n# License\n\nApache License Version 2.0\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawamuray%2Fwasmtime-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkawamuray%2Fwasmtime-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawamuray%2Fwasmtime-java/lists"}