From 1dd33e7a53781c5caa68036eeda4e839fa956eb2 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 3 Sep 2020 16:05:38 +0200 Subject: [PATCH 1/6] Renamed ruby-ext-wasm to wasmer-ruby --- CHANGELOG.md | 58 +++++++++++++++++++++++++------------------------- Cargo.lock | 2 +- Cargo.toml | 4 ++-- README.md | 53 +++++++++++++++++---------------------------- wasmer.gemspec | 2 +- 5 files changed, 52 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5385f57..5e9f9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ All notable changes to this project will be documented in this file. ### Added * Support exported global variables - ([#32](https://github.com/wasmerio/ruby-ext-wasm/pull/32) by + ([#32](https://github.com/wasmerio/wasmer-ruby/pull/32) by [@Hywan]) ```ruby @@ -32,34 +32,34 @@ All notable changes to this project will be documented in this file. ``` * Support memory without an exported memory - ([#31](https://github.com/wasmerio/ruby-ext-wasm/pull/31) by + ([#31](https://github.com/wasmerio/wasmer-ruby/pull/31) by [@Hywan]) ### Changed * Set `@memory` to `nil` if none is exported - ([#33](https://github.com/wasmerio/ruby-ext-wasm/pull/33) by + ([#33](https://github.com/wasmerio/wasmer-ruby/pull/33) by [@Hywan]) * Migrate CI from CircleCI to Github Actions - ([#28](https://github.com/wasmerio/ruby-ext-wasm/pull/28) by + ([#28](https://github.com/wasmerio/wasmer-ruby/pull/28) by [@Hywan]) * Format code - ([#26](https://github.com/wasmerio/ruby-ext-wasm/pull/26) by + ([#26](https://github.com/wasmerio/wasmer-ruby/pull/26) by [@Atul9]) * Update Rutie to 0.7.0 (Rust) and 0.0.4 (Ruby) - ([#23](https://github.com/wasmerio/ruby-ext-wasm/pull/23) by + ([#23](https://github.com/wasmerio/wasmer-ruby/pull/23) by [@Hywan]) * Update Wasmer from 0.6.0 to 0.14.0 - ([#23](https://github.com/wasmerio/ruby-ext-wasm/pull/23), - [#24](https://github.com/wasmerio/ruby-ext-wasm/pull/24), - [#25](https://github.com/wasmerio/ruby-ext-wasm/pull/25), - [#35](https://github.com/wasmerio/ruby-ext-wasm/pull/35), + ([#23](https://github.com/wasmerio/wasmer-ruby/pull/23), + [#24](https://github.com/wasmerio/wasmer-ruby/pull/24), + [#25](https://github.com/wasmerio/wasmer-ruby/pull/25), + [#35](https://github.com/wasmerio/wasmer-ruby/pull/35), by [@Hywan]) ### Security * Update `rake` and other dependencies - ([#36](https://github.com/wasmerio/ruby-ext-wasm/pull/36) by + ([#36](https://github.com/wasmerio/wasmer-ruby/pull/36) by [@Hywan]) ## [0.3.0] - 2019-07-16 @@ -67,11 +67,11 @@ All notable changes to this project will be documented in this file. ### Added * Add the `Memory.grow` method - ([#19](https://github.com/wasmerio/ruby-ext-wasm/pull/19) by + ([#19](https://github.com/wasmerio/wasmer-ruby/pull/19) by [@Hywan]) * Typed arrays implement [the `Enumerable` mixin](https://docs.ruby-lang.org/en/2.6.0/Enumerable.html) - ([#15](https://github.com/wasmerio/ruby-ext-wasm/pull/15) by + ([#15](https://github.com/wasmerio/wasmer-ruby/pull/15) by [@irxground]) ```ruby @@ -86,7 +86,7 @@ All notable changes to this project will be documented in this file. ``` * Implement `instance.exports.respond_to?` to test whether an exported function exists - ([#9](https://github.com/wasmerio/ruby-ext-wasm/pull/9) by + ([#9](https://github.com/wasmerio/wasmer-ruby/pull/9) by [@irxground]) ```ruby @@ -95,32 +95,32 @@ All notable changes to this project will be documented in this file. assert instance.exports.respond_to?(:foo) ``` * Handle exported functions that return nothing, aka void functions - ([#8](https://github.com/wasmerio/ruby-ext-wasm/pull/8) by [@Hywan]) + ([#8](https://github.com/wasmerio/wasmer-ruby/pull/8) by [@Hywan]) * Add the `greet` eaxmple - ([#12](https://github.com/wasmerio/ruby-ext-wasm/pull/12) by + ([#12](https://github.com/wasmerio/wasmer-ruby/pull/12) by [@Hywan]) * Set up Bors - ([#10](https://github.com/wasmerio/ruby-ext-wasm/pull/10) by + ([#10](https://github.com/wasmerio/wasmer-ruby/pull/10) by [@Hywan]) ### Changed * Improve Ruby exception raising - ([#5](https://github.com/wasmerio/ruby-ext-wasm/pull/5) by + ([#5](https://github.com/wasmerio/wasmer-ruby/pull/5) by [@irxground]) * Update Wasmer to 0.5.5 - ([#20](https://github.com/wasmerio/ruby-ext-wasm/pull/20) by + ([#20](https://github.com/wasmerio/wasmer-ruby/pull/20) by [@Hywan]) * Update Wasmer to 0.4.2 - ([#11](https://github.com/wasmerio/ruby-ext-wasm/pull/11) by + ([#11](https://github.com/wasmerio/wasmer-ruby/pull/11) by [@Hywan]) * Update Wasmer to 0.4.1 - ([#7](https://github.com/wasmerio/ruby-ext-wasm/pull/7) by [@Hywan]) + ([#7](https://github.com/wasmerio/wasmer-ruby/pull/7) by [@Hywan]) * Update Rutie - ([#16](https://github.com/wasmerio/ruby-ext-wasm/pull/16) by + ([#16](https://github.com/wasmerio/wasmer-ruby/pull/16) by [@edvakf]) * Move all symbols inside the `Wasmer` module - ([#4](https://github.com/wasmerio/ruby-ext-wasm/pull/4) by + ([#4](https://github.com/wasmerio/wasmer-ruby/pull/4) by [@irxground]) ```ruby @@ -129,18 +129,18 @@ All notable changes to this project will be documented in this file. ``` * Improve documentation - ([#14](https://github.com/wasmerio/ruby-ext-wasm/pull/14) by + ([#14](https://github.com/wasmerio/wasmer-ruby/pull/14) by [@denniscollective]) * Use `assert_nil` instead of `assert_equal_nil` in tests - ([#13](https://github.com/wasmerio/ruby-ext-wasm/pull/13) by + ([#13](https://github.com/wasmerio/wasmer-ruby/pull/13) by [@Hywan]) ## [0.2.0] - 2019-05-01 -[Unreleased]: https://github.com/wasmerio/ruby-ext-wasm/compare/0.4.0...HEAD -[0.4.0]: https://github.com/wasmerio/ruby-ext-wasm/compare/0.3.0...0.4.0 -[0.3.0]: https://github.com/wasmerio/ruby-ext-wasm/compare/0.2.0...0.3.0 -[0.2.0]: https://github.com/wasmerio/ruby-ext-wasm/compare/0.1.0...0.2.0 +[Unreleased]: https://github.com/wasmerio/wasmer-ruby/compare/0.4.0...HEAD +[0.4.0]: https://github.com/wasmerio/wasmer-ruby/compare/0.3.0...0.4.0 +[0.3.0]: https://github.com/wasmerio/wasmer-ruby/compare/0.2.0...0.3.0 +[0.2.0]: https://github.com/wasmerio/wasmer-ruby/compare/0.1.0...0.2.0 [@Hywan]: https://github.com/Hywan [@irxground]: https://github.com/irxground [@edvakf]: https://github.com/edvakf diff --git a/Cargo.lock b/Cargo.lock index f7dc1fc..b46f4ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -405,7 +405,7 @@ version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "ruby-ext-wasm" +name = "wasmer-ruby" version = "0.4.0" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index fa8cdaf..e6e833a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] publish = false -name = "ruby-ext-wasm" +name = "wasmer-ruby" version = "0.4.0" authors = ["Ivan Enderlin "] edition = "2018" description = "Ruby extension to run WebAssembly binaries" readme = "README.md" -repository = "https://github.com/wasmerio/ruby-ext-wasm" +repository = "https://github.com/wasmerio/wasmer-ruby" keywords = ["ruby", "extension", "webassembly"] categories = ["wasm"] diff --git a/README.md b/README.md index 847136d..2968113 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,14 @@ -

- - Wasmer logo - -

- -

- - Join the Wasmer Community - - Gem - - Number of gem downloads - - License -

- -Wasmer is a Ruby library for executing WebAssembly binaries: - - * **Easy to use**: The `wasmer` API mimics the standard WebAssembly API, - * **Fast**: `wasmer` executes the WebAssembly modules as fast as possible, - * **Safe**: All calls to WebAssembly will be fast, but more - importantly, completely safe and sandboxed. - -# Install - -To install the `wasmer` Ruby gem, just run this command in your shell: +# Wasmer logo Wasmer Ruby [![Gem version](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) -```sh -$ gem install wasmer -``` +A complete and mature WebAssembly runtime for Ruby based on [Wasmer]. + +Features: + + * **Easy to use**: The `wasmer` API mimics the standard WebAssembly API, + * **Fast**: `wasmer` executes the WebAssembly modules as fast as + possible, close to **native speed**, + * **Safe**: All calls to WebAssembly will be fast, but more + importantly, completely safe and sandboxed. **Note**: [Rust][rust] is required to install the Ruby library (Cargo —the build tool for Rust— is used to compile the extension). See [how @@ -36,6 +16,7 @@ to install Rust][install-rust]. [View the `wasmer` gem on RubyGems][wasmer-gem]. +[Wasmer]: https://github.com/wasmerio/wasmer [rust]: https://www.rust-lang.org/ [install-rust]: https://www.rust-lang.org/tools/install [wasmer-gem]: https://rubygems.org/gems/wasmer @@ -43,7 +24,7 @@ to install Rust][install-rust]. # Example There is a toy program in `examples/simple.rs`, written in Rust (or -any other language that compiles to Wasm): +any other language that compiles to WebAssembly): ```rust #[no_mangle] @@ -52,8 +33,10 @@ pub extern fn sum(x: i32, y: i32) -> i32 { } ``` -Once this program compiled to WebAssembly, we end up with a -`examples/simple.wasm` binary file. +After compilation to WebAssembly, the +[`examples/simple.wasm`](https://github.com/wasmerio/wasmer-ruby/blob/master/examples/simple.wasm) +binary file is generated. ([Download +it](https://github.com/wasmerio/wasmer-ruby/raw/master/examples/simple.wasm)). Then, we can execute it in Ruby (!) with the `examples/simple.rb` file: @@ -72,7 +55,9 @@ $ ruby simple.rb 3 ``` -# API documentation +# Documentation + +Browse Wasmer Ruby Gem docs at https://www.rubydoc.info/gems/wasmer/. ## The `Instance` class diff --git a/wasmer.gemspec b/wasmer.gemspec index a540e91..55a6978 100644 --- a/wasmer.gemspec +++ b/wasmer.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = "Run WebAssembly binaries." spec.description = "Wasmer is a Ruby extension to run WebAssembly binaries." - spec.homepage = "https://github.com/wasmerio/ruby-ext-wasm" + spec.homepage = "https://github.com/wasmerio/wasmer-ruby" spec.license = "MIT" spec.extensions = %w(Rakefile) From 0fd1dba253ae4b7c887c65ddaa32f49e1ab01487 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 3 Sep 2020 16:08:05 +0200 Subject: [PATCH 2/6] Improved README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2968113..020d808 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wasmer logo Wasmer Ruby [![Gem version](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) +# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) A complete and mature WebAssembly runtime for Ruby based on [Wasmer]. From 0121710124e2ddad188acffdcadf0f15bb269415 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 3 Sep 2020 16:09:10 +0200 Subject: [PATCH 3/6] Fixed README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 020d808..05d18ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) +# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) A complete and mature WebAssembly runtime for Ruby based on [Wasmer]. From fcdbc6c6d1a6e603986c78ddae12b6deeeef4787 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 3 Sep 2020 16:09:40 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05d18ca..f698056 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) +# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) ![[Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) A complete and mature WebAssembly runtime for Ruby based on [Wasmer]. From 889b2f871ddcf72c87fddbbc855cd37888c0a1d7 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Thu, 3 Sep 2020 16:10:29 +0200 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f698056..aff43be 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) ![[Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) +# Wasmer logo Wasmer Ruby [![Wasmer Ruby Gem version](https://img.shields.io/gem/v/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Ruby Gem Documentation](https://img.shields.io/badge/docs-read-green)](https://www.rubydoc.info/gems/wasmer/) [![Wasmer Ruby Gem downloads](https://img.shields.io/gem/dt/wasmer.svg)](https://rubygems.org/gems/wasmer) [![Wasmer Slack Channel](https://img.shields.io/static/v1?label=chat&message=on%20Slack&color=green)](https://slack.wasmer.io) A complete and mature WebAssembly runtime for Ruby based on [Wasmer]. From e9f356504a44eb5a16ab3ea56b411da2c3f9453e Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 3 Sep 2020 16:32:17 +0200 Subject: [PATCH 6/6] Add back install section --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05d18ca..751f501 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,24 @@ Features: * **Safe**: All calls to WebAssembly will be fast, but more importantly, completely safe and sandboxed. -**Note**: [Rust][rust] is required to install the Ruby library (Cargo +> Note: [Rust][rust] is required to install the Ruby library (Cargo —the build tool for Rust— is used to compile the extension). See [how to install Rust][install-rust]. -[View the `wasmer` gem on RubyGems][wasmer-gem]. - [Wasmer]: https://github.com/wasmerio/wasmer [rust]: https://www.rust-lang.org/ [install-rust]: https://www.rust-lang.org/tools/install + +# Install + +To install the `wasmer` Ruby gem, just run this command in your shell: + +```sh +$ gem install wasmer +``` + +[View the `wasmer` gem on RubyGems][wasmer-gem]. + [wasmer-gem]: https://rubygems.org/gems/wasmer # Example