We Compiled a Golang Database in the Browser Using WebAssembly
pingcap.com
pingcap.com
We had a lot of fun—and learned a lot—from our little adventure at TiDB Hackathon 2019. If you want to make your own Golang applications run in a browser, here are some suggestions:
As [WebAssembly Weekly - Issue #100](https://wasmweekly.news/issue-100/) mentioned, "WebAssembly support for Go applications is very much in its infancy.” For example, Golang hasn't fully supported WASI, and goleveldb doesn’t support Wasm/js. Be discreet before you go too deep, and clearly understand the use cases for your application.
Make sure your application doesn't have third-party platform-specific dependencies that can’t be compiled to Wasm.
Browsers don’t allow port listening and file operations, so you’ll have to work around those limitations.