All Projects → danieljoos → go-wasm-examples

danieljoos / go-wasm-examples

Licence: other
Some small examples of using Go and WebAssembly

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to go-wasm-examples

Made With Webassembly
A showcase of awesome production applications, side projects, and use cases made with WebAssembly (Wasm). 👷
Stars: ✭ 132 (+500%)
Mutual labels:  example, webassembly, wasm
Webassembly Examples
From Simple To Complex. A complete collection of webassembly examples.
Stars: ✭ 177 (+704.55%)
Mutual labels:  example, webassembly, wasm
Wasm By Example
Wasm By Example is a website with a set of hands-on introduction examples and tutorials for WebAssembly (Wasm)
Stars: ✭ 226 (+927.27%)
Mutual labels:  example, webassembly, wasm
warpy
WebAssembly interpreter in RPython
Stars: ✭ 54 (+145.45%)
Mutual labels:  webassembly, wasm
jasper
🧳 Single-binary packaging for Ruby applications that supports native and Wasm targets
Stars: ✭ 29 (+31.82%)
Mutual labels:  webassembly, wasm
wasmsign2
PoC implementation of the WebAssembly Modules Signatures proposal.
Stars: ✭ 18 (-18.18%)
Mutual labels:  webassembly, wasm
ugo-compiler-book
📚 µGo语言实现(从头开发一个迷你Go语言编译器)[Go版本+Rust版本]
Stars: ✭ 996 (+4427.27%)
Mutual labels:  webassembly, wasm
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (+50%)
Mutual labels:  webassembly, wasm
imgalign
Webapplication for image stitching and aligning
Stars: ✭ 162 (+636.36%)
Mutual labels:  webassembly, wasm
gearoenix
Cross-platform C++ 3D game engine.
Stars: ✭ 33 (+50%)
Mutual labels:  webassembly, wasm
image-hub
Image Hub is a sample application for exploring WebAssembly modules used as Envoy filters.
Stars: ✭ 56 (+154.55%)
Mutual labels:  webassembly, wasm
wasm-linker-js
A simple WebAssembly Linker in JavaScript
Stars: ✭ 14 (-36.36%)
Mutual labels:  webassembly, wasm
wasm-ops
Chart of WebAssembly Instructions
Stars: ✭ 46 (+109.09%)
Mutual labels:  webassembly, wasm
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (+77.27%)
Mutual labels:  webassembly, wasm
vrcpu
Code, documentation, schematics, notes for my Ben Eater inspired breadboard computer and emulator
Stars: ✭ 98 (+345.45%)
Mutual labels:  webassembly, wasm
vmrp
mrp emulator, virtual machine, mrp模拟器
Stars: ✭ 126 (+472.73%)
Mutual labels:  webassembly, wasm
widgets playground
Showcase example for https://github.com/therecipe/qt
Stars: ✭ 50 (+127.27%)
Mutual labels:  example, webassembly
node-wasi
WASI for Node.js
Stars: ✭ 64 (+190.91%)
Mutual labels:  webassembly, wasm
block-aligner
SIMD-accelerated library for computing global and X-drop affine gap penalty sequence-to-sequence or sequence-to-profile alignments using an adaptive block-based algorithm.
Stars: ✭ 58 (+163.64%)
Mutual labels:  webassembly, wasm
Electron Wasm Rust Example
A minimal Electron + WebAssembly (WASM) + 🦀 Rust example.
Stars: ✭ 227 (+931.82%)
Mutual labels:  example, webassembly

go-wasm-examples

Some small examples of using Go and WebAssembly

The examples require at least Go version 1.12!

Usage

The server directory contains a very small HTTP server implementation that simply hosts the files of the current working directory. It also downloads the wasm_exec.js JavaScript bridge from the official golang repository, if the file doesn't already exist.

go build -o server.bin ./server
./server.bin

You can also use any other web-server that provides static file hosting.

Example 1:

The first example prints a "Hello World" to the console of the browser. Browse to http://localhost:3000 after building the example:

GOARCH=wasm GOOS=js go build -o test.wasm ./wasm1

Example 2:

The second example interacts with the DOM of the page and enables the "Stop" button. It also registers a click handler on the button and keeps the go program alive until the button was pressed. Browse to http://localhost:3000 after building the example:

GOARCH=wasm GOOS=js go build -o test.wasm ./wasm2

Example 3:

The third example shows how to create elements in the DOM. It uses the github.com/PaulRosset/go-hacknews package to fetch the top 10 stories from Hacker News and displays them as list of anchors in the DOM. Browse to http://localhost:3000 after building the example:

go get -u github.com/PaulRosset/go-hacknews
GOARCH=wasm GOOS=js go build -o test.wasm ./wasm3

Example 4:

The fourth example implements a very simple markdown editor that uses the package github.com/shurcooL/github_flavored_markdown to render github-flavoured markdown to HTML. Browse to http://localhost:3000 after building the example:

go get -u github.com/shurcooL/github_flavored_markdown
GOARCH=wasm GOOS=js go build -o test.wasm ./wasm4
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].