I was a drive-by contributor to TinyGo, focused on getting MacOS and JS/WASM working well this summer, along with getting BubbleTea to work with it (the last of which was finally merged yesterday!). It was a lot of work, but now it unlocked so much capability for me.
The TinyGo project is an intensely talented cadre of developers. They care deeply this alternative Go compiler/runtime. It was really neat to see them in action and how an already established project accelerated in a year.
It was interesting to see how they adopted LLMs (basically use them but you better know what's going on) and how they dealt with newcomers. The project's scaffolding has improved to keep pace.
While it was intended to get Golang on small devices, the same love makes it work well for WASM. Also it improves as LLVM improves.
I rather consistently get 50% size binaries that run 10% faster and use lower memory than Vanilla Go. The drawback is 5x slower build times. So I dev-loop with Vanilla go and then prod-loop with TinyGo.
Booba will help you embed your Golang in a browser, either Vanilla or TinyGo. There's still some go.mod friction, but the next BubbleTea release will fix that.
Very nice! I have really been enjoying TinyGo for a couple Pi Pico projects I've been toying with.
Way saner than the C pico projects I've helped my friend work on.
Maybe it's just me but I kind of wish there was more of a way to clearly differentiate a Go project from a Tiny Go project, like .tgo file extensions or like a "compiler tinygo" directive in go.mod or something.
Part of my LLM-and-agentic-learning phase is giving up interpreted web dev languages and forcing myself to develop agentic skills by using a language I am less familiar with.
I have some Go experience (a small utility used by some dozens of quite niche customers) and trivial experience of macOS development.
So far my two projects have been Go/Gin/goose etc. — a web app — and a small desktop Swift app. But there's GUI stuff for Go and web stuff for Swift. (I could have written my mac app exactly in Golang because there's a package that does what I need)
I had hoped I would find that one of these languages was clearly better than the other. Go is obviously better for the LLM, maybe a bit tiresome to see enormous reams of it for me. Swift is a little harder on the LLM (and it builds more slowly) but it's a bit easier on the eye; I've been very productive in it.
Here, again, it will be hard to separate TinyGo and Embedded Swift.
Swift has no garbage collector(just reference counting) as opposed to Go, which should make it a better fit for microcontrollers, since the runtime is lighter
I'm using it to generate WASM, sadly Go with the GC/goroutine infra is not as good a WASM language than e.g. Rust which is a very simple 'binary', TinyGo works well though.
Many aren't, it's a big ask. But I'm more interested in spreading the idea than selling something. I found WASM an underrated gem - e.g. https://pglite.dev/
So you want to take arbitrary code in arbitrary languages, and run it on someone else's computer inside a sandbox?
Yes, wasm can do that.
You can compile the code to wasm, then run it in a runtime like wasmer or wasmtime. Or you can ahead-of-time compile it with something like wasm2c, which generates C code.
awesome. I love tinygo - these days mainly to be able to 'dual serve' my go services as cloudflare workers via the tinygo wasm target. works beautifully.
TinyGo has been my favorite means of using my Raspi Picos so far. My only gripe so far is that maps are nigh unusable due to their slowness, but this is generally simple enough to work around (at the expense of performance). I'm sure there are still more rough edges, but I don't think I'm experienced enough with embedded software to identify them.
Are some of the improvements coming from TamaGo? I know there was supposed to exist a collaboration with other Go toolchains, if I remember correctly a issue that I saw fly by in the past.
I was a drive-by contributor to TinyGo, focused on getting MacOS and JS/WASM working well this summer, along with getting BubbleTea to work with it (the last of which was finally merged yesterday!). It was a lot of work, but now it unlocked so much capability for me.
The TinyGo project is an intensely talented cadre of developers. They care deeply this alternative Go compiler/runtime. It was really neat to see them in action and how an already established project accelerated in a year.
It was interesting to see how they adopted LLMs (basically use them but you better know what's going on) and how they dealt with newcomers. The project's scaffolding has improved to keep pace.
While it was intended to get Golang on small devices, the same love makes it work well for WASM. Also it improves as LLVM improves.
I rather consistently get 50% size binaries that run 10% faster and use lower memory than Vanilla Go. The drawback is 5x slower build times. So I dev-loop with Vanilla go and then prod-loop with TinyGo.
Booba will help you embed your Golang in a browser, either Vanilla or TinyGo. There's still some go.mod friction, but the next BubbleTea release will fix that.
https://nimbleterminal.com/booba
Here's some TinyGo interactive graphics next to Vanilla:
https://nimblemarkets.github.io/ntcharts3d/?demo=gallery&com...
Pro-tip: use gc=boehm for JS/WASM targets
Out of curiosity, what can and can't TinyGo do that the official Go compiler/runtime can do ?
Very nice! I have really been enjoying TinyGo for a couple Pi Pico projects I've been toying with.
Way saner than the C pico projects I've helped my friend work on.
Maybe it's just me but I kind of wish there was more of a way to clearly differentiate a Go project from a Tiny Go project, like .tgo file extensions or like a "compiler tinygo" directive in go.mod or something.
Sorry, I did not use tiny go yet (it's on my bucket list for a long time), i thought it's compatible with go, why would you need a differentiation?
That is usually done with the build tags, for different OSes and arches, and TinyGo defines the tinygo build tag.
Part of my LLM-and-agentic-learning phase is giving up interpreted web dev languages and forcing myself to develop agentic skills by using a language I am less familiar with.
I have some Go experience (a small utility used by some dozens of quite niche customers) and trivial experience of macOS development.
So far my two projects have been Go/Gin/goose etc. — a web app — and a small desktop Swift app. But there's GUI stuff for Go and web stuff for Swift. (I could have written my mac app exactly in Golang because there's a package that does what I need)
I had hoped I would find that one of these languages was clearly better than the other. Go is obviously better for the LLM, maybe a bit tiresome to see enormous reams of it for me. Swift is a little harder on the LLM (and it builds more slowly) but it's a bit easier on the eye; I've been very productive in it.
Here, again, it will be hard to separate TinyGo and Embedded Swift.
And there's WASM support for both.
Swift has no garbage collector(just reference counting) as opposed to Go, which should make it a better fit for microcontrollers, since the runtime is lighter
I'm using it to generate WASM, sadly Go with the GC/goroutine infra is not as good a WASM language than e.g. Rust which is a very simple 'binary', TinyGo works well though.
Yep. I use it on https://github.com/rcarmo/go-rdp for my RDP web client.
Could I ask how you do that? How do you actually build with a webassembly target? I might be interested.
From the TinyGo docs, it’s as simple as
https://tinygo.org/docs/guides/webassembly/wasm/It relies on LLVM’s Wasm backend and some JS glue libraries for the browser.
<Shameless plug> https://appfuzz.dev/ https://appos.build/
Appreciated.
that's really interesting, thank you. I'm not sure we're ready to use that platform, though :)
Many aren't, it's a big ask. But I'm more interested in spreading the idea than selling something. I found WASM an underrated gem - e.g. https://pglite.dev/
Agreed. DuckDB wasm is amazing. [1]
[1] https://github.com/duckdb/duckdb-wasm
It is!
So you want to take arbitrary code in arbitrary languages, and run it on someone else's computer inside a sandbox?
Yes, wasm can do that.
You can compile the code to wasm, then run it in a runtime like wasmer or wasmtime. Or you can ahead-of-time compile it with something like wasm2c, which generates C code.
w2c2 is also very good
Or (shameless plug) if you want to generate Go from Wasm: https://github.com/ncruces/wasm2go
awesome. I love tinygo - these days mainly to be able to 'dual serve' my go services as cloudflare workers via the tinygo wasm target. works beautifully.
TinyGo has been my favorite means of using my Raspi Picos so far. My only gripe so far is that maps are nigh unusable due to their slowness, but this is generally simple enough to work around (at the expense of performance). I'm sure there are still more rough edges, but I don't think I'm experienced enough with embedded software to identify them.
Lots of goodies in the release.
Congratulations to the team.
Are some of the improvements coming from TamaGo? I know there was supposed to exist a collaboration with other Go toolchains, if I remember correctly a issue that I saw fly by in the past.