All notable changes to this project will be documented in this file.
1.0.0 - 2021-07-01
It's basically the 0.5.0 version. The only noticeable change is that the Wasmer runtime has been updated to version 2.0.
0.5.0 - 2021-05-17
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
andexports
,Exports
, which represents a collection of exported entities, withrespond_to_missing?
,method_missing
, andlength
,ImportObject
, which represents a collection of imports that will be passed toInstance
, withnew
,contains_namespace
, andregister
,Function
, which represents an imported or exported function, withnew
,call
andtype
,Memory
, which represents an imported or exported memory, withnew
,type
,size
,data_size
,grow
, + memory views that extendsEnumerable
,Global
, which represents an imported or exported global, withnew
,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
andEnvironment
classes.
- Online documentation, with tested examples (#51 by @Hywan)
- Tests run against Ruby 2.7 + 3.0, and against Linux + macOS (#49 by @Hywan)
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 - 2020-02-03
-
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
- 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)
0.3.0 - 2019-07-16
-
Typed arrays implement the
Enumerable
mixin (#15 by @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
-
Implement
instance.exports.respond_to?
to test whether an exported function exists (#9 by @irxground)instance = Wasmer::Instance.new(self.bytes) assert instance.exports.respond_to?(:foo)
-
Handle exported functions that return nothing, aka void functions (#8 by @Hywan)
-
Improve Ruby exception raising (#5 by @irxground)
-
Move all symbols inside the
Wasmer
module (#4 by @irxground)# Read from the `Wasmer` module. instance = Wasmer::Instance.new()
-
Improve documentation (#14 by [@denniscollective])
-
Use
assert_nil
instead ofassert_equal_nil
in tests (#13 by @Hywan)