ebiten icon indicating copy to clipboard operation
ebiten copied to clipboard

Try TinyGo

Open hajimehoshi opened this issue 5 years ago • 11 comments

https://github.com/aykevl/tinygo

hajimehoshi avatar Dec 16 '18 10:12 hajimehoshi

Would this specifically be for the WebAssembly target?

peterhellberg avatar Jan 04 '19 11:01 peterhellberg

Yes, that's right :-)

hajimehoshi avatar Jan 04 '19 11:01 hajimehoshi

There is now an llvm formula for use by tinygo under macOS here: https://github.com/tinygo-org/homebrew-tools (The mainline llvm formula does not support the wasm target as of yet)

Will report back if I get it compiled and working with tinygo.

The installation instructions should probably be something like this though:

brew tap tinygo-org/tools
brew install tinygo-org/tools/llvm

peterhellberg avatar Jan 07 '19 12:01 peterhellberg

https://github.com/trashhalo/tinygo-import-report Hmm

hajimehoshi avatar May 20 '19 12:05 hajimehoshi

Note that thetinygo-import-report was updated 6 months ago, and a lot has happened in TinyGo since.

peterhellberg avatar May 20 '19 13:05 peterhellberg

I was wondering how I can know the latest situation.

hajimehoshi avatar May 20 '19 14:05 hajimehoshi

It looks like https://github.com/trashhalo/tinygo-import-report/blob/master/report.go is used to generate a new report in the README.

peterhellberg avatar May 20 '19 14:05 peterhellberg

The easiest way to try TinyGo is using Docker:

docker pull tinygo/tinygo:latest
docker run --rm -v $(pwd):/src -w /src tinygo/tinygo:latest tinygo build -o wasm.wasm -target=wasm -tags=example ./examples/rotate

EDIT: LOL, this finishes silently but without dumping anything.

hajimehoshi avatar Aug 21 '20 13:08 hajimehoshi

https://github.com/tinygo-org/tinygo/issues/1304

hajimehoshi avatar Aug 21 '20 13:08 hajimehoshi

The last issue I had trying to build an wasm ebiten app with tinygo was https://github.com/tinygo-org/tinygo/issues/2236 But tinygo/tinygo-dev:latest seems to now fix the build. Then we should use this wasm_exec.js file to skip a runtime error : https://github.com/tinygo-org/tinygo/blob/release/targets/wasm_exec.js

And after that, I personally fall on this issue: https://github.com/tinygo-org/tinygo/issues/1037

I don't know if it's the same for you

Zyko0 avatar Nov 11 '21 11:11 Zyko0

Update as of today (ebiten 2.3.1, tinygo 0.23)

On Windows

❯ tinygo run .\cmd\app\main.go
# github.com/hajimehoshi/ebiten/v2/internal/glfw
..\..\..\go\pkg\mod\github.com\hajimehoshi\ebiten\[email protected]\internal\glfw\notexternaldll_windows.go:51:22: UserCacheDir not declared by package os

On Linux

❯ tinygo run .\cmd\app\main.go
# os/user
../../../../usr/lib/go/src/os/user/cgo_lookup_unix.go:18:6: not implemented: build constraints in #cgo line

Seems to be issue https://github.com/tinygo-org/tinygo/issues/770

martinlindhe avatar May 12 '22 10:05 martinlindhe

I think there is no action item from Ebitengine side.

hajimehoshi avatar Apr 01 '23 13:04 hajimehoshi