days
-7
0
hours
0
-4
minutes
-1
-1
seconds
0
-5
search
Running in the browser

Vugu: Experimental library for web UI in Go, targeting WebAssembly

Sarah Schlothauer
webassembly
© Shutterstock /gem.ini

WebAssembly and Go, together in the browser with Vugu! This experimental library is for writing web UIs in pure Go, targeting WebAssembly. It takes inspiration from UI libraries such as Vue and React. While we wait for its v1.0 release, take a look at its current features and future plans.

Despite WebAssembly‘s newness, it’s quickly created a large amount of buzz and programming fans. WASM aims to be a JavaScript companion, although there are some rankings that proclaim WASM may eventually dethrone JavaScript. The tools and libraries for WebAssembly keep on coming, reaching a wide variety of use cases. Now, add Go onto the bandwagon.

Vugu is an experimental modern UI library for Go and WebAssembly. It receives inspiration from modern, widely-used UI libraries such as Vue and React. Let’s see what this library does and explore some of the highlights.

Web UIs using pure Go

The GitHub README expresses that Vugu is built “more like a library than a framework”. It allows users to easier write web user interfaces in pure Go, instead of using JavaScript.

No node. No JS. No npm. No node_modules folder competing with your music library for disk space.

https://github.com/vugu/vugu/blob/master/README.md

Users write UI components in .vugu files, which contain Go language expressions. Then, the .vugu files are converted to .go files using either an automatic development server or via the vugugen command line tool.WebAssembly and Go, together in the browser! This experimental library is for writing web UIs in pure Go, targeting WebAssembly. It takes inspiration from UI libraries such as Vue and React. While we wait for its v1.0 release, take a look at its current features and future plans.

SEE ALSO: Golang grows in the enterprise: Half of users program with Go daily

The project compiles to a WebAssembly module, which allows it to run in the browser. When compiling, users have full reign to customize individual aspects of the project, if needed.

Read the documentation for more information about how this library functions. Read the Vugu Program Structure page to help fully understand how to create your program.

Check out the playground available in the browser.

Features & future plans

Some of the current features include:

  • Standard Go build tools
  • Simple dev environment
  • Write idiomatic Go code
  • Single-file components
  • Vue-like markup syntax
  • Quick set up
  • Rapid prototyping
  • Multi-browser support: Currently officially supports newer versions of Chrome, Firefox, and Microsoft Edge. However, according to the FAQ, any browser that supports WASM and is targetable by Go should work. Use a different browser? Give it a test.

SEE ALSO: Compile your Swift code into WebAssembly with SwiftWasm

According to the roadmap in the GitHub README, future plans include:

This project is still an active work-in-progress and is still in its early, experimental phases. Thus, users should proceed with this in mind. According to the FAQ: “Once WebAssembly is no longer experimental in Go, and more mature in general, Vugu 1.0 will probably be released at that time”.

Find out how to get started. You will need at least Go version 1.12.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

Leave a Reply

2 Comments on "Vugu: Experimental library for web UI in Go, targeting WebAssembly"

avatar
400
  Subscribe  
Notify of
Brad Peabody
Guest

Thanks for the Vugu article! The project is still very new but it’s great to see the interest and I am excited about the possibilities this technology holds for the future.

Paul D
Guest

Hi Brad. How is the router coming along? I think I would like to use it.