Releases: wasmerio/wasmer-ruby
1.0.0
It's basically the 0.5.0 version. The only noticeable change is that
the Wasmer runtime has been updated to version 2.0.
Added
Changed
0.5.0
This is a full rewrite of the entire project. This version is a
candidate to become the 1.0 version.
We advise to take a look at:
Shortly, here are the new types the extension provides:
Store
, which holds the engine, the compiler etc.Module
, which represents a Wasm module, withvalidate
,new
,
name=
,name
,exports
,imports
,custom_sections
,
serialize
anddeserialize
,Instance
, which represents a Wasm instance, withnew
and
exports
,Exports
, which represents a collection of exported entities, with
respond_to_missing?
,method_missing
, andlength
,ImportObject
, which represents a collection of imports that will
be passed toInstance
, withnew
,contains_namespace
, and
register
,Function
, which represents an imported or exported function, with
new
,call
andtype
,Memory
, which represents an imported or exported memory, with
new
,type
,size
,data_size
,grow
, + memory views that
extendsEnumerable
,Global
, which represents an imported or exported global, with
new
,mutable?
,value
,value=
, andtype
,Table
, which represents an imported or exported table, withnew
(small API for the moment),Type
,FunctionType
,MemoryType
,GlobalType
andTableType
,ExportType
andImportType
,Value
which represents a Wasm value,Wasi
module, which provides theVersion
,StateBuilder
and
Environment
classes.
Added
- Online documentation, with tested examples
(#51 by [@Hywan]) - Tests run against Ruby 2.7 + 3.0, and against Linux + macOS
(#49 by [@Hywan])
Changed
As we said, the extension has been fully rewritten, and the code is
likely to not be compatible anymore. Here are the most notable
patches:
0.4.0
Added
-
Support exported global variables (#32 by @Hywan)
instance = Wasmer::Instance.new bytes x = instance.globals.x assert x.mutable assert_equal x.value, 7 x.value = 42 assert_equal x.value, 42
Changed
- Set
@memory
tonil
if none is exported (#33 by @Hywan) - Migrate CI from CircleCI to Github Actions (#28 by @Hywan)
- Format code (#26 by @Atul9)
- Update Rutie to 0.7.0 (Rust) and 0.0.4 (Ruby) (#23 by @Hywan)
- Update Wasmer from 0.6.0 to 0.14.0 (#23, #24, #25, #35, by @Hywan)
Security
0.3.0
Features
Extension
-
#15 Typed arrays implement the
Enumerable
mixin (@irxground)memory = instance.memory.uint8_view pointer string = "" # Now we can write this more Ruby idiomatic loop: memory.each do |char| break if char == 0 string += char.chr end
-
#9 Implement
instance.exports.respond_to?
to test whether an exported function exists (@irxground)instance = Wasmer::Instance.new(self.bytes) assert instance.exports.respond_to?(:foo)
-
#5 Improve Ruby exception raising (@irxground)
Runtime
- #20 Update Wasmer to 0.5.5 (@Hywan)
- #11 Update Wasmer to 0.4.2 (@Hywan)
- #7 Update Wasmer to 0.4.1 (@Hywan)
Bug/security fixes
-
#8 Handle exported functions that return nothing, aka void functions (@Hywan)
-
#4 Move all symbols inside the
Wasmer
module (@irxground)# Read from the `Wasmer` module. instance = Wasmer::Instance.new()