November 2009, Google, Inc. announced a new concurrent programming language, Go. Although announced as a lab experimental release, Go’s importance to the community is evidenced by ranking 13th in the March
2010 TIOBE Report. Go presents considerable opportunity for the SVG
community, since Go does not have an official graphical user interface
library and since concurrency lends itself well to UI development.
This paper addresses integrating Go and SVG and is organized along three themes.
- Recent prior work for SVG generation from Go. Most work to date is limited to the generation of static SVG from Go, which is can be displayed after the Go program ends.
- The proposed technique, GAS. GAS provides an interactive UI architecture using SVG and AJAX as the graphical interface to a concurrently executing Go program.
- Possible future trends and directions for Go and SVG including NaCl, browsers extensions, and porting SVG rendering systems natively to Go.
Methods of expressing concurrency with Go and SVG are explored and some concrete
examples using the GAS API’s and Go are presented.
GAS stands for Go, Ajax, and SVG. In the GAS system, a Go program
employing a FastCGI interface runs behind an HTTP server. SVG renders
server-side running Go application program that is linked with GAS libraries.
the server, where the GAS libraries deliver the events to the Go
program. A goroutine picks up the event and schedules it via a
Go callback routine. The Go program may respond by initiating
indirect mutations to the SVGDOM.
An SVGDOM abstraction layer in Go is used to facilitate convenient access to the SVGDOM resident in the browser. This is accomplished by a mechanism called
A demonstration of sample Go programs using the GAS system, running under Ubuntu Linux, Apache2, an FastCGI will be shown.
A promising area for future development can be found in NaCl (Native Client).
NaCl is an open-source technology for running native code in web applications.
NaCl is in a early stage of release, and although current versions have issues, the NaCl technology looks very promising to deliver high performance UI experiences in the browser.
The GAS API’s could be adapted to a client-running SVG and Go application
when Go and NaCl integration is available and when SVG rendering via Go and NaCl is possible.
Thus the present GAS API architecture should
function under the framework presented and offer future adaptability to
client SVG deployments once NaCl and Go in the browser becomes viable.