Running a Command line tool written in Go on browser with WebAssembly

Related tags

WebAssembly go wasm
Overview

Running a command line tool written in Go on browser with WebAssembly

This repo contains code/assets from the article

Files:

.
├── article.md           ---  Article explaining the code
├── index.html           ---  Demo UI page
├── worker.js            ---  JS code for Demo UI Page
├── oldindex.html        ---  Code from the article
├── pdfcpu               ---  Linux x86_64 native binary
├── pdfcpu.wasm          ---  Compiled wasm module of pdfcpu
├── pdfcpu.wasm.br       ---  Brotli compression output
├── pdfcpu.wasm.gz       ---  Gzip compression output
├── README.md            ---  This file
├── static_server.js     ---  A simple HTTP static file server in Node.js, with wasm MIME type support for development
├── wasm_exec.js.orig    ---  Original wasm_exec.js from Go v1.12.4 installation (misc/wasm), for diff'ing changes
└── wasm_exec.js         ---  Modified to add Filesystem emulation support in browser with BrowserFS
Issues
  • panic: syscall/js: call of Value.Int on undefined

    panic: syscall/js: call of Value.Int on undefined

    [This isn't a problem with pdfcpu - but I'm looking for some guidance :)] Hi, firstly I just wanted to say thank you for all the work here, it's help me get mostly up and running.

    I have a golang program that has to Stat the file, and I'm getting a heap of errors like you've described but I can't seem to solve. Specifically it seems to fail with 'panic: syscall/js: call of Value.Int on undefined' and the stack trace points to an error when Go system library trys to read atimeMs, which I think is set by retStat.atimeMs = retStat.atime.getTime();

    Have you experience any similar problems? I am trying to debug it but not getting amazingly far.

    opened by PaulKinlan 2
Go compiler running entirely in your browser

wasm-go-playground This is the Go compiler ("gc") compiled for WASM, running in your browser! It can be used to run a simple playground, à la play.gol

Chris 234 May 17, 2022
A Brainfuck to WebAssembly compiler written in Go.

brainfuck2wasm A Brainfuck to WebAssembly compiler written in Go. I am writing this compiler for a Medium article. When I complete the compiler, I'll

Luke I. Wilson 2 Jun 6, 2022
WebAssembly interop between Go and JS values.

vert Package vert provides WebAssembly interop between Go and JS values. Install GOOS=js GOARCH=wasm go get github.com/norunners/vert Examples Hello W

null 73 Jun 22, 2022
WebAssembly for Proxies (Golang host implementation)

WebAssembly for Proxies (GoLang host implementation) The GoLang implementation for proxy-wasm, enabling developer to run proxy-wasm extensions in Go.

MOSN 37 May 28, 2022
🐹🕸️ WebAssembly runtime for Go

Wasmer Go Website • Docs • Slack Channel A complete and mature WebAssembly runtime for Go based on Wasmer. Features Easy to use: The wasmer API mimics

Wasmer 2.1k Jun 23, 2022
🐹🕸️ WebAssembly runtime for Go

Wasmer Go Website • Docs • Slack Channel A complete and mature WebAssembly runtime for Go based on Wasmer. Features Easy to use: The wasmer API mimics

Wasmer 2.1k Jul 1, 2022
Golang-WASM provides a simple idiomatic, and comprehensive API and bindings for working with WebAssembly for Go and JavaScript developers

A bridge and bindings for JS DOM API with Go WebAssembly. Written by Team Ortix - Hamza Ali and Chan Wen Xu. GOOS=js GOARCH=wasm go get -u github.com/

TeamOrtix 71 Jun 23, 2022
A package to build progressive web apps with Go programming language and WebAssembly.

Go-app is a package for building progressive web apps (PWA) with the Go programming language (Golang) and WebAssembly (Wasm). Shaping a UI is done by

Maxence Charriere 6.2k Jul 1, 2022
A package to build progressive web apps with Go programming language and WebAssembly.

Go-app is a package for building progressive web apps (PWA) with the Go programming language (Golang) and WebAssembly (Wasm). Shaping a UI is done by

Maxence Charriere 6.2k Jun 26, 2022
Vugu: A modern UI library for Go+WebAssembly (experimental)

Vugu: A modern UI library for Go+WebAssembly (experimental)

Vugu 4.4k Jul 4, 2022
WebAssembly runtime for wasmer-go

gowasmer When compiling Go to WebAssembly, the Go compiler assumes the WebAssembly is going to run in a JavaScript environment. Hence a wasm_exec.js f

mattn 87 Jun 18, 2022
A template project to demonstrate how to run WebAssembly functions as sidecar microservices in dapr

Live Demo 1. Introduction DAPR is a portable, event-driven runtime that makes it easy for any developer to build resilient, stateless and stateful app

Second State 121 Jun 21, 2022
Tiny, blazing fast WebAssembly compute

Sat, the tiny WebAssembly compute module Sat (as in satellite) is an experiment, and isn't ready for production use. Please try it out and give feedba

Suborbital 278 Jul 2, 2022
WebAssembly Lightweight Javascript Framework in Go (AngularJS Inspired)

Tango Lightweight WASM HTML / Javascript Framework Intro WebAssembly is nice, Go on the web is nice, so I ported Tangu to Go and WebAssembly. Tangu is

enimatek 4 Jun 8, 2022
This library provides WebAssembly capability for goja Javascript engine

This module provides WebAssembly functions into goja javascript engine.

YC-L 1 Jan 10, 2022
Dom - A Go API for different Web APIs for WebAssembly target

Go DOM binding (and more) for WebAssembly This library provides a Go API for dif

Denys Smirnov 455 Jun 16, 2022
wazero: the zero dependency WebAssembly runtime for Go developers

wazero: the zero dependency WebAssembly runtime for Go developers WebAssembly is a way to safely run code compiled in other languages. Runtimes execut

Tetrate Labs 1.7k Jul 4, 2022
Run WASM tests inside your browser

wasmbrowsertest Run Go wasm tests easily in your browser. If you have a codebase targeting the wasm platform, chances are you would want to test your

Agniva De Sarker 125 Jul 6, 2022
The in-browser IDE for Go

Go Wasm Go Wasm is a Go development environment with the essentials to write and run code entirely within the browser, using the power of WebAssembly

John Starich 433 Jun 27, 2022