WebAssembly System Interface (WASI) with Sockets for Go
Go v1.21, scheduled for release in August 2023, adds experimental support for the WebAssembly System Interface (WASI). It'll be possible to natively compile server-side WebAssembly applications with Go, making Go a first-class citizen along with C/C++, Rust and Zig. GOOS=wasip1 GOARCH=wasm go build ... WASI is still in preview and is missing some key features, e.g. the ability to create sockets. Some WebAssembly runtimes have taken the initiative to extend the WASI preview, enabling a wider range of applications to run as WebAssembly modules. Today, we're open sourcing our WASI library…
What it does
In the maker’s words, at launch
Go v1.21, scheduled for release in August 2023, adds experimental support for the WebAssembly System Interface (WASI). It'll be possible to natively compile server-side WebAssembly applications with Go, making Go a first-class citizen along with C/C++, Rust and Zig. GOOS=wasip1 GOARCH=wasm go build ... WASI is still in preview and is missing some key features, e.g. the ability to create sockets. Some WebAssembly runtimes have taken the initiative to extend the WASI preview, enabling a wider range of applications to run as WebAssembly modules. Today, we're open sourcing our WASI library and sockets extension for the Wazero WebAssembly runtime (https://wazero.io). https://github.com/stealthrocket/wasi-go The WASI library includes a wasirun command that can be used to run server-side WebAssembly applications compiled with Go: ~ $ cat << EOF > hello.go package main import "fmt" func main() { fmt.Println("Hello, World!") } EOF ~ $ GOOS=wasip1 GOARCH=wasm gotip build -o hello.wasm hello.go ~ $ wasirun hello.wasm Hello, World! Non-blocking I/O and basic networking is also supported when compiling apps from Go, e.g. see https://gist.github.com/chriso/6c71e968ef1002981a6ff46ceaa39.... Until Go v1.21 is released in August, you can use gotip (https://pkg.go.dev/golang.org/dl/gotip) to try GOOS=wasip1 features. The provided sockets extension is compatible with the WasmEdge (https://wasmedge.org) runtime, allowing wasirun to run more complicated server-side applications compiled from C/C++/Rust/Zig for WasmEdge. We have many exciting use cases for WebAssembly and WASI planned and can't wait to share them with you.
Does the same job
all alternatives →- WSWASI socket extensions for Go 1.212023 · github.com · ▲6
The WASI preview 1 specification was missing socket APIs so some WebAssembly runtimes added extensions to allow applications to do more than basic file I/O. This package enables a large class of Go programs (almost any program doing networking) to run when compiled to WebAssembly using the WASI preview 1 spec. It exposes functions similar to net.Dial and net.Listen that can be used to leverage the socket extensions thanks to the new //go:wasmimport compiler directive. It also has a set of examples of how to use popular Go packages when compiling to GOOS=wasip1. Contributions…
- WAWasmer – A Go library for executing WebAssembly binaries2019 · github.com · ▲44
- WSWebassembly.sh – WebAssembly WASI Terminal on your Browser2019 · webassembly.sh · ▲8

- LALife – A secure, blazing-fast, cross-platform WebAssembly VM in Go2018 · github.com · ▲111
More dev tools this month
the category →



Open-source GTM skills for technical founders
Dev tools · 29d ago · gtmcofounder.com

OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.
Dev tools · 1d ago · opentrailpaper.com

Launched alongside, May 2023
the whole month →
- BR
In today's world, catchy headlines and articles often distract readers from the facts and relevant information. By utilizing OpenAI's language models, Boring Report processes sensationalist news articles, transforms them into the content you see, and helps readers focus on the essential details. We recently updated our iOS app experience, so any and all feedback would be appreciated. App Link: https://apps.apple.com/us/app/boring-report-news-by-ai/id644...
AI · 2023 · boringreport.org



Momentum Page▲834Launch your website in seconds, get users in minutes
Dev tools · 2023 · page.mmntm.build