Programming

Golang 1.11 rc1 is here with experimental port for WebAssembly!

3 min read

Golang team released Golang 1.11 rc1 version, earlier this week. The latest release explores features like web assembly (js/wasm ), preliminary support for modules and improved support for debuggers among others.

Golang is currently one of the fastest growing programming languages in the software industry. Golang’s easy syntax, concurrency, and fast nature are few of the reasons for its popularity. It is a modern programming language, created by Google back in 2009 for the 21st-century application development.

Let’s have a look at the key features that come with Golang 1.11 rc1.

WebAssembly ( js/wasm)

WebAssembly is different in the sense that it is not processed by a CPU directly, but instead, it is an intermediate representation which is compiled to actual machine code by the WebAssembly runtime environment.

Now, Go 1.11 rc1 has added an experimental port to WebAssembly (js/wasm). Go programs used to compile to only one WebAssembly module. These modules include the Go runtime for goroutine scheduling, garbage collection, maps, etc. Because of this, the resulting size would be around 2 MB, or 500 KB compressed. Go programs can call into JavaScript with the help of new experimental syscall/js package.

Now, with new GOOS value “js” and GOARCH value “wasm” added to the web assembly, Go files named *_js.go or *_wasm.go will now be ignored by Go tools except for cases when GOOS/GOARCH values are being used. The GOARCH name “wasm” is the official abbreviation of WebAssembly. The GOOS name “js” is due to the host environment that executes WebAssembly bytecode are web browsers and Node.js, both of which use JavaScript to embed WebAssembly.

Preliminary support for modules

Go 1.11 rc1 offers preliminary support for a new concept called “modules,” which is an alternative to GOPATH with integrated support for versioning and package distribution. With modules, developers are not limited to working inside GOPATH. Also, the version dependency information is explicit yet lightweight, and builds are more reliable.

Improved support for debuggers

The compiler in Go 1.11 rc1 now produces significantly accurate debug information for optimized binaries. This includes variable location information, line numbers, and breakpoint locations.

Due to this, it is easier to debug binaries compiled without -N -l. There are still few limitations to the quality of the debug information which will improve with the future releases.

DWARF sections have been compressed by default. This is due to the accurate debug information produced by the compiler. This is transparent to most ELF tools (like debuggers on Linux and *BSD) and is supported by the Delve debugger on all platforms.  

Other changes

  • Many direct system calls have been removed from the macOS runtime.
  • Go 1.11 binaries are now less likely to break on upgrading macOS version because system calls are made through the proper channel (libc).

Go 1.11 is expected to be released later this month. For more information, check out the official release notes.

Read Next

Writing test functions in Golang [Tutorial]

How Concurrency and Parallelism works in Golang [Tutorial]

GoMobile: GoLang’s Foray into the Mobile World

Natasha Mathur

Tech writer at the Packt Hub. Dreamer, book nerd, lover of scented candles, karaoke, and Gilmore Girls.

Share
Published by
Natasha Mathur

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago