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

Share
  • July 19, 2019

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.

The post Vugu: Experimental library for web UI in Go, targeting WebAssembly appeared first on JAXenter.

Source : JAXenter