{"id":16801416,"url":"https://github.com/lonelycode/wasmy","last_synced_at":"2025-10-18T18:15:03.155Z","repository":{"id":57647785,"uuid":"442956608","full_name":"lonelycode/wasmy","owner":"lonelycode","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-08T04:42:51.000Z","size":18596,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T15:17:04.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/lonelycode.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}},"created_at":"2021-12-30T03:35:17.000Z","updated_at":"2022-01-08T04:42:08.000Z","dependencies_parsed_at":"2022-08-25T08:20:28.757Z","dependency_job_id":null,"html_url":"https://github.com/lonelycode/wasmy","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lonelycode%2Fwasmy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lonelycode%2Fwasmy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lonelycode%2Fwasmy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lonelycode%2Fwasmy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lonelycode","download_url":"https://codeload.github.com/lonelycode/wasmy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982141,"owners_count":20378605,"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":"2024-10-13T09:36:47.163Z","updated_at":"2025-10-18T18:14:58.112Z","avatar_url":"https://github.com/lonelycode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wasmy\nA utility wrapper to make WASM plugins less painful\n\n## Context\nWasm is great, but passing values between host \u003c-\u003e guest is uneccessarily complicated and not well documented across the various runtimes. \n\nThe reason it is hard is because WASM only allows for integer and float types to be shared between guest and host. That means no strings, no structured objects or arrays.\n\nWASM does provide a shared linear memory block though, which is what should be used to move data into and out of WASM modules. Whgile using it for trivial examples is fine, using it in anger starts getting very messy and in no-way general purpose.\n\nThere is a standard WASI - Web Assembly Shared Interfaces - that might one day make this a great deal easier by enabling socket-based i/o between guest and host, but it's very early days. If you want to do anything complex with WASM (e.g. making an HTTP request), you need to import that capability from your host langauge. \n\n## What does Wasmy do?\nWasmy provides wrapper functions and a shared mempry manager that handles function i/o for you, giving you clean interface{} types on either end of the toolchain. When using Wasmy, you do not need to worry about how to get data into and out of WASM, because it's handled for you. \n\nThe goal is to make WASM more accessible for us average folks that just want to JFDI.\n\n## Usage\n\nSee the `wasm-tests/managedv2.go` file for an example of how to write WASM functions that can be exported in go. to compile the wasm file you'll need TinyGo:\n\n```\ntinygo build -o wasm-tests/managedv2.wasm -wasm-abi=generic  -target=wasi wasm-tests/managedv2.go\n```\n\nTo see how to call a function in this wasm file, you'll also need to compile a runner, see `example/example.go` for a sample application. \n\nCompiling it is as simple as runnign `go build`.\n\nWhen you ruin the example app, you should see output like the below:\n\n```\nvmuser@codeserv:~/wasmy/example$ ./example \ninside module: hello martin\nFrom Host: Hello Mr. anderson\nhost function output from inside module: From Host: Hello Mr. anderson\nfunction output (from runner): hello martin \n```\n\n## Warnings and Caveats\n\n- This is an experimental library and has not been used in anger\n- The i/o buffers for guest and host functions are currently set to 1024 bytes, this can be increased by modiying `FUNCBUFFER_SIZE`. WASM requires fixed array sizes so a byte slice isn't suitable.\n- There's no overflow checks in place yet, so use at your peril\n- This lib was written for Go-based WASM modules, to work with other languages like AssemblyScript or Rust the wrappers will need to be converted first\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flonelycode%2Fwasmy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flonelycode%2Fwasmy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flonelycode%2Fwasmy/lists"}