{"id":18001633,"url":"https://github.com/rigtorp/go-pikchr","last_synced_at":"2025-08-17T09:32:45.192Z","repository":{"id":137958394,"uuid":"584961894","full_name":"rigtorp/go-pikchr","owner":"rigtorp","description":"Pikchr wrapped for Go using WebAssembly. No cgo required.","archived":false,"fork":false,"pushed_at":"2023-04-04T03:23:22.000Z","size":53,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-16T22:23:38.766Z","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":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rigtorp.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-01-04T00:50:06.000Z","updated_at":"2024-03-24T20:22:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"21888685-672f-496d-84b0-3aab4bfdb70d","html_url":"https://github.com/rigtorp/go-pikchr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigtorp%2Fgo-pikchr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigtorp%2Fgo-pikchr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigtorp%2Fgo-pikchr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigtorp%2Fgo-pikchr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rigtorp","download_url":"https://codeload.github.com/rigtorp/go-pikchr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230113667,"owners_count":18175220,"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-29T23:18:14.778Z","updated_at":"2024-12-17T12:07:32.880Z","avatar_url":"https://github.com/rigtorp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pikchr for Go\n\nThis package wraps [Pikchr](https://pikchr.org) as a Go package. It doesn't rely\non cgo or an external binary, instead using the [wazero](https://wazero.io/)\nWebAssembly runtime to embed Pikchr.\n\nWazero is configured to sandbox Pikchr such that Pikchr only has access to the\ninput and output data.\n\n## Performance\n\nFor a small Pikchr figure, go-pikchr takes about 7.5ms:\n\n```shell\n$ go test -test.bench .\ngoos: linux\ngoarch: amd64\npkg: github.com/rigtorp/go-pikchr\ncpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz\nBenchmarkPikchr-8            142           7520289 ns/op\nPASS\nok      github.com/rigtorp/go-pikchr    1.471s\n```\n\n## Building Pikchr for WASM\n\nDownload [wasi-sdk](https://github.com/WebAssembly/wasi-sdk) and extract it\nsomewhere.\n\nNext build Pikchr:\n\n```shell\nexport WASI_SDK_PATH=/path/to/wasi/sdk\n$WASI_SDK_PATH/bin/clang pikchr.c -o pikchr.wasm -DPIKCHR_SHELL -Os -DNDEBUG -s\n```\n\n## Acknowledgements\n\nI got the idea for this approach of embedding an external program in Go using\nWebAssembly from the blog post [The carcinization of Go\nprograms](https://xeiaso.net/blog/carcinization-golang).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigtorp%2Fgo-pikchr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frigtorp%2Fgo-pikchr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigtorp%2Fgo-pikchr/lists"}