Experimenting with Full Stack Development in Go — Part 4: Reflections
Writing a basic web application with a WASM based Go frontend and a serverless Go backend is very doable. The backend supports are quite mature and the frontend supports are evolving.
Although Go is not a very natural choice for frontend development, it is likely that there will be some contexts where a project will prefer to use the same language and tooling on both frontend and backend rather than needing to deal with quite different technologies.
Go offers the advantages of strict type checking in the compile process and printing quite helpful debug information at runtime in case of error, both of which are helpful to frontend developers. (This is not specific to Go of course — other WASM based solutions also offer this).
The vecty
library is good but basic, offering support for DOM manipulation and linking browser based event mechanisms to the Go/WASM environment.
This work raised a number of open issues relating to Go frontend development, including the following:
- Is it straightforward to drop autogenerated REST API libraries into a Go frontend? Are there good patterns for linking this to frontend data?
- Does it make sense to handle REST calls synchronously in a goroutine or to use the more common asynchronous event based mechanisms common in the Javascript world?
- How well does a Go/WASM module interact with other Javascript libraries running within a page?
- Component libraries do not really exist although the vugu project looks interesting albeit in early stages of development
This was a quite fun and interesting project and I hope to do some further investigation of the combination of Go, serverless and WASM which could appear on a medium post near you sometime soon…