Hacker News new | ask | show | jobs
by goliatone 1292 days ago
OT but I’ve been working with WASM and TinyGo and hit an unexpected roadblock: TinyGo lacks JSON support (because the native go implementation uses reflection).

That meant that I couldn’t find a way to serialize structs between host and WASM compiled functions/modules.

The initial implementation of what I wanted to do took me half an hour. Trying and testing serialization libraries (JSON, protobuf, msgpack) took me four days and couldn’t find one that worked (working on a apple M1 made things more complicated). The one left to try is karmem but I just had to move on and be productive.

I used goja instead to get unstuck but now I want to find a working solution :)

1 comments

https://pkg.go.dev/github.com/CosmWasm/tinyjson#section-read...

Looks like it would be a reasonable solution?