/Simple-WASM_Go

Just a little try to create simple WebAssembly using GO.

Primary LanguageJavaScript

Simple WASM - GO WebAssembly

Type : Web/Situs web

Halođź‘‹

Language: English

Description:

Just a little try to create simple WebAssembly using GO.

Structure

So i'll explain my understanding about this project, here's the structure how WebAssembly GO Works:

Server
path: server/main.go this is for the web server, wich will catch address and throw back some WebAssembly Component that will be display to user (In this implementation i use 8081 port). Just run this, and the server will be active.

WebAssembly GO
path: wasm/main.go this is for the WebAssembly code, wich we can build to .wasm file using:
GOOS=js GOARCH=wasm go build -o ../main.wasm.

All of these components is interrelated,

  1. Client/User --(sending request address)--> server/main.go
    Then server will preparing the WASM,
    server/main.go --(preparing)--> WASM Component (index.html, script.js, main.wasm)

  2. WASM Preparing process:
    index.html --(get WASM action through js)--> script.js --(js Get WASM action)--> main.wasm

  3. And finally,
    main.wasm will return some action to index.html through script.js so that client/user can receive the requested action in index.html


Youtube Reference: Go and WebAssembly | Learn the Basics of WASM

Instruction :

  • Clone this repo ( git clone https://github.com/Khip01/Simple-WASM_Go.git )
  • Then run the server/main.go

Code Editor :

  • Visual Studio Code

Use

My Skills