Skip to content

Commit

Permalink
move files up, use individual go command binaries, add formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ccbrown committed Jul 5, 2019
1 parent 444431e commit ca357bc
Show file tree
Hide file tree
Showing 930 changed files with 175 additions and 667,660 deletions.
10 changes: 4 additions & 6 deletions README.md
Expand Up @@ -2,7 +2,7 @@

This is the Go compiler ("gc") compiled for WASM, running in your browser! It can be used to run a simple playground, à la [play.golang.org](https://play.golang.org/) entirely in your browser!

You can try it out here: https://ccbrown.github.io/go-web-gc/server/
You can try it out here: https://ccbrown.github.io/go-web-gc

#### ⚠️ Important ⚠️

Expand All @@ -11,8 +11,6 @@ You can try it out here: https://ccbrown.github.io/go-web-gc/server/

## Code

This repo very much has "proof of concept" / "make it work" organization. Here's a low effort explanation of what things are:

* ./go – Almost everything in this directory was copied directly from the Go source. The only exceptions are go/cmd/link/link.go and go/cmd/compile/compile.go. These files basically turn the "link" and "compile" commands into libraries that can be used to link and compile an executable.
* ./main.go – This uses the "compile" and "link" libraries to compile a single Go file into a WASM file. This is compiled to WASM and copied to ./server/build.wasm.
* ./server – This contains all the static files for an in-browser Go playground. Most of the files are either precompiled WASM or lightly modified copies of bits and pieces from [play.golang.org](https://play.golang.org/). The most substantial work in this directory is in index.html and wasm_exec.js as wasm_exec.js needed a virtual filesystem implementation.
* ./cmd – These are Go commands compiled for WASM. They were all produces by running commands such as `GOOS=js GOARCH=wasm go build -o ~/go/src/github.com/ccbrown/go-web-gc/compile.wasm .` from the Go source directories.
* ./prebuilt – These are prebuilt runtime WASM files. These were produced by copying them from Go's cache after compiling anything for WASM.
* . – This contains all the static files for an in-browser Go playground. Most of the files are either precompiled WASM or lightly modified copies of bits and pieces from [play.golang.org](https://play.golang.org/). The most substantial work here is in index.html and wasm_exec.js as wasm_exec.js needed a virtual filesystem implementation.
Binary file renamed server/build.wasm → cmd/compile.wasm
Binary file not shown.
Binary file added cmd/gofmt.wasm
Binary file not shown.
Binary file added cmd/link.wasm
Binary file not shown.
5 changes: 0 additions & 5 deletions go.mod

This file was deleted.

3 changes: 0 additions & 3 deletions go.sum

This file was deleted.

18 changes: 0 additions & 18 deletions go/cmd/compile/compile.go

This file was deleted.

32 changes: 0 additions & 32 deletions go/cmd/compile/internal/amd64/galign.go

This file was deleted.

154 changes: 0 additions & 154 deletions go/cmd/compile/internal/amd64/ggen.go

This file was deleted.

0 comments on commit ca357bc

Please sign in to comment.