• Stars
    star
    183
  • Rank 210,154 (Top 5 %)
  • Language
    TypeScript
  • Created about 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A version of play.golang.org that runs completely in the browser

Go Playground WASM

This is an experiment in trying to make a version of play.golang.org that runs completely in the browser by compiling goscript (by oxfeeefeee) to WASM.

Most of Go's language features are supported, notably channels/goroutines/select.

Building and running

The wasm binary is pre-compiled and available in the public/ directory so you should be good to go to if you just want to run the Next.js server. You will need to install node and yarn of course.

# Run in development mode
yarn dev

# Build and serve optimized production build
yarn build
yarn start

If you want to play around with modifying the wasm build, cd into goscript/wasm and you can mess around with the code. When you want to build the wasm binary run:

# Build wasm
cargo build --release --target=wasm32-wasi

# Copy into Next.js's public folder
cp target/wasm32-wasi/release/wasm.wasm ../public

Disclaimer

goscript only makes guarantees that the syntax will be identical to Go's, there are implementation details that will cause discrepancies from running actual Go code with the actual Go compiler.

More Repositories

1

aussieplusplus

Programming language from down under
Rust
612
star
2

tyvm

An experimental bytecode interpreter / type-checker for type-level Typescript
Zig
430
star
3

glyph

My own personal code editor built with Rust + OpenGL
Rust
157
star
4

rust-vs-zig

Comparing unsafe Rust vs Zig by writing a bytecode interpreter with GC in both langs
Rust
154
star
5

node-soundcloud-downloader

A SoundCloud API v2 wrapper for Node.js
TypeScript
134
star
6

tyfsm

(wip) simple and typesafe finite automata based state management library. Inspired by zustand and xstate
TypeScript
123
star
7

tether

WIP high-performance code editor inspired by Doom Emacs and neovim. Comes with explosions.
Zig
65
star
8

lofi-cli

Listen to ChilledCow's lofi hip-hop stream from the command line
JavaScript
27
star
9

soundcloud-api

A SoundCloud API v2 wrapper for Go
Go
26
star
10

write-your-own-zod

Write your own Zod from scratch
TypeScript
14
star
11

force-directed-graph

experiment
Rust
11
star
12

bun-macros-flappy-bird

C
5
star
13

prisma2gql

prisma schema 2 graphql schema generator
Haskell
4
star
14

iszacksleeping

A way to actually contact me and hold me accountable to a sleep schedule
TypeScript
3
star
15

toilet-paper-twitter

a stupid graphics experiment
HTML
3
star
16

cheatsheets

TypeScript
2
star
17

rasta

Building a software rasterizer for fun
Rust
2
star
18

downloadsound.cloud-api-go

Go
1
star
19

c-template

Simple C project starter template
C
1
star
20

rust-emscripten-bug

Rust
1
star
21

youtube-rooms-frontend

TypeScript
1
star
22

learning-crdts-rust

Learning and implementing CRDTs in Rust
Rust
1
star
23

downloadsound.cloud-api

TypeScript
1
star
24

youtube-rooms

Go
1
star
25

downloadsound.cloud

TypeScript
1
star
26

sticky

Fixing my broken right arrow key
Objective-C
1
star