Menu
Major change proposed for WebAssembly

Major change proposed for WebAssembly

Proposed extension to enable functions to return multiple values would reduce code size and improve compiler efficiency, among other benefits

Credit: Dreamstime

WebAssembly, the highly touted binary format intended to speed up web applications, is slated to add a multi-value capability, enabling functions to return many values and bringing code size benefits and new instruction possibilities.

The proposal would lift current restrictions on functions, which can return only a zero or one value, and instruction sequences such as blocks, ifs, and loops, which cannot consume stack values and only can produce zero or a single resulting stack value.

With these restrictions gone, functions could return an arbitrary number of values and instruction sequences could produce an arbitrary number of stack values, according to a bulletin posted by Mozilla and Bytecode Alliance. Multi-value also is a prerequisite for Wasm interface types that describe high-level values such as records, sequences, and strings. 

The motivation behind the multi-value plan is that multiple return values for functions enable unboxing of tuples or structs returned by values and efficient compilation of multiple return values. In addition, loop labels can have arguments and there can be macro definability of instructions with inputs, the formal proposal on GitHub states.

Implementing multi-values would leave the structure and text format of the language mostly unaffected. The binary format requires a change to allow function types as block types. The current ad hoc encoding must be extended to allow references to function types. Developer Nick Fitzgerald said he has added multi-value support to crates in the Rust and WebAssembly toolchain as well as to the Wasmtime WebAssembly runtime.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Brand Post

What to expect from your IT Distributor

Whether you’re just starting out or you’ve been around since before the dot com rollercoaster, choosing the right distribution partner can be a pivotal factor in your success. This definitive guide outlines the traits that every IT partner needs to look for in their IT Distributor.

Featured

Slideshows

Channel gathers to celebrate the Reseller News Innovation Awards 2020 winners

Channel gathers to celebrate the Reseller News Innovation Awards 2020 winners

More than 500 channel leaders gathered in Auckland on 21 October at the ​Reseller News Innovation Awards ​2020 to celebrate the achievements of the New Zealand technology industry's top partners, start-ups, vendors, distributors and individuals.

Channel gathers to celebrate the Reseller News Innovation Awards 2020 winners
Meet the winners of the 2020 Reseller News Innovation Awards

Meet the winners of the 2020 Reseller News Innovation Awards

Reseller News honoured the standout players of the New Zealand channel in front of more than 500 technology leaders in Auckland on 21 October, recognising the achievements of top partners, start-ups, vendors, distributors and individuals.

Meet the winners of the 2020 Reseller News Innovation Awards
Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

This year’s Reseller News 30 Under 30 Tech Awards were held as an integral part of the first entirely virtual Emerging Leaders​ forum, an annual event dedicated to identifying, educating and showcasing the New Zealand technology market’s rising stars. The 30 Under 30 Tech Awards 2020 recognised the outstanding achievements and business excellence of 30 talented individuals​, across both young leaders and those just starting out. In this slideshow, Reseller News honours this year's winners and captures their thoughts about how their ideas of leadership have changed over time.​

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners
Show Comments