Porting Go to TinyGo - help!

Hi, I’m not sure there’s much TinyGo action here but I’m struggling to find help and the TinyGo channel on gophers slack is rather quiet.

I’m looking for advice, suggestions, warnings etc about attempting to port a Golang project (git-bug which has lots of deps) to TinyGo Is this a bad idea? Are there any other places to look than the gophers slack, here and tinygo.org?

The firs thing I though was to try building to see how that goes and check for missing dependencies, but the command tinygo build -o git-bug in a newly cloned git-bug repo downloads the dependencies and then fails immediately with:

build github.com/MichaelMure/git-bug: cannot load runtime/debug: malformed module path "runtime/debug": missing dot in first path element

I can’t find ‘runtime/debug’ anywhere in the repo so I’m stuck at the moment and looking for blogs and people to ask, with not much luck so far.

Just curious, is there any reason to use TinyGo for deployment? AFAIK, they are a research team exploring Go possibility into embedded now.

WASM was available long time ago in standard Go compiler.

Suggest raise a Github issue with prefix “Question: how to …?” That would be a lot faster and would not scare the maintainers.

2 Likes

Someone suggested I use TinyGo as a way to reduce the bundle size for a WASM build. I don’t know by how much at this point, but thought it might be worth investigating TinyGo first.

Apparantly Go WASM output is large because the whole runtime is needed due to lack of support for garbage collection.

I see. Just to cross-check before you use my tip, have you attempted their official guidelines? https://tinygo.org/getting-started/

Per my understanding, tiny-go is like a Go compiler (see: https://tinygo.org/usage/basic/). Obviously, you don’t need to compile from scratch.

EDIT: I forgot to tell you, remember to read this before use: https://tinygo.org/lang-support/. Not all features are supported yet (they are working on it).

2 Likes

I just searched around a bit on tinygo’s Github page and found this, so it looks like this may be one of the known current limitations of tinygo’s runtime implementation.

2 Likes

Thanks @skillian, that’s a great help and shows me how to track down any similar errors.

FYI I filed an issue to clarify the situation:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.