Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(wasm-languages): go updates #1403

Merged
merged 1 commit into from
Oct 30, 2024
Merged

docs(wasm-languages): go updates #1403

merged 1 commit into from
Oct 30, 2024

Conversation

vdice
Copy link
Member

@vdice vdice commented Oct 30, 2024

This PR originally started with the goal of updating the example manifest to v2 and removing the base trigger config due to be removed in Spin 3 (ref #1376 (comment)).

I coudn't help but update a few tangential items along the way, but stopped short of revising the go/tinygo lay-of-the-land.

We can either collaborate in this PR to update the main text to reflect recent go/tinygo updates/support (pinging @adamreese @rajatjindal and others) or this can be a follow-up.

Copy link

🚀 preview deployed successfully to Fermyon Cloud and available at https://fermyon-developer-pr-1403-giddccgf.fermyon.app

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

@adamreese
Copy link
Member

@vdice The changes in this PR look good. Is there a particular section that you were looking for more input on?

@vdice
Copy link
Member Author

vdice commented Oct 30, 2024

@adamreese Yes mostly to see if anything should to be updated/revised in the first overview section of the page, i.e.

Go was early to the WebAssembly game, with the Go compiler producing `wasm32` output alongside its regularly supported build targets.
But the core Go tools have fallen behind.
Instead, the alterative Go implementation called [TinyGo](https://tinygo.org/) seems to have taken the lead.
## Available Implementations
- Go supports browser-based WebAssembly
- TinyGo supports `wasm32-wasi` as a build target
- The [Elements compiler](https://www.elementscompiler.com/elements/) may also support compiling browser-oriented Wasm
We have had the best luck with TinyGo.
## Usage
With TinyGo, it is possible to compile _most_ Go code into Wasm with WASI support.
That means you can write Go code targeting the Fermyon Platform.
## Pros and Cons
Things we like:
- TinyGo works very well
- Spin has full support for Go
We're neutral about:
- The resulting binary sizes start at around 300k, but can rapidly climb
Things we're not big fans of:
- Upstream (mainline) Go does not have WASI support
- TinyGo is still missing (mostly reflection-based) features of Go

@itowlson
Copy link
Contributor

Build error is unrelated broken links which are fixed in the v3 work.

@itowlson itowlson merged commit 8a39b59 into main Oct 30, 2024
2 of 3 checks passed
@vdice vdice deleted the docs/wasm-lang-go-updates branch October 30, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants