Home IT News Ruvy converts Ruby code to WebAssembly

Ruvy converts Ruby code to WebAssembly

0
Ruvy converts Ruby code to WebAssembly

[ad_1]

E-commerce supplier Shopify has open-sourced its Ruvy challenge, which gives a toolchain that takes Ruby code and creates a WebAssembly module that executes that Ruby code.

Shopify believes Ruvy might be helpful to the broader developer group by offering an easy method to construct and execute easy Ruby packages in WebAssembly runtimes. Launched October 18, and accessible from GitHub, Ruvy was created to reap the benefits of efficiency enhancements from pre-initializing the Ruby digital machine and Ruby recordsdata included by the Ruby script.

Ruvy doesn’t require WASI (WebAssembly System Interface) arguments to be supplied at runtime, Shopify stated, noting that Ruvy Wasm modules take about 70% much less time to compile to native code. Ruvy boosts efficiency by pre-initializing the Ruby digital machine when the Wasm module is constructed.

Constructed on prime of ruby.wasm, a group of WebAssembly ports of CRuby, Ruvy presently doesn’t ship with precompiled binaries, so construct dependencies need to be put in after which Ruvy should be compiled earlier than use. Particulars on putting in these dependencies could be discovered within the challenge’s ReadMe part. After constructing Ruvy, builders can run:

$ cargo run --package=cli ruby_examples/hello_world.rb -o index.wasm 
$ wasmtime index.wasm 
Hey world

Wasm recordsdata created by Ruvy don’t require a file path as a WASI argument. This promotes compatibility with computing environments that can not be configured to supply extra WASI arguments to start out capabilities, reminiscent of some edge computing companies, Shopify stated.

Copyright © 2023 IDG Communications, Inc.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here