Skip to content

Commit

Permalink
Merge pull request #41 from wasmerio/improvements
Browse files Browse the repository at this point in the history
Renamed ruby-ext-wasm to wasmer-ruby
  • Loading branch information
Hywan authored Sep 3, 2020
2 parents 89fa8e2 + dfe2fd2 commit 788946f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 66 deletions.
58 changes: 29 additions & 29 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,46 +32,46 @@ 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

### 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
publish = false
name = "ruby-ext-wasm"
name = "wasmer-ruby"
version = "0.4.0"
authors = ["Ivan Enderlin <ivan.enderlin@hoa-project.net>"]
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"]

Expand Down
60 changes: 27 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<p align="center">
<a href="https://wasmer.io" target="_blank" rel="noopener">
<img width="300" src="https://raw.githubusercontent.com/wasmerio/wasmer/master/assets/logo.png" alt="Wasmer logo">
</a>
</p>

<p align="center">
<a href="https://spectrum.chat/wasmer">
<img src="https://withspectrum.github.io/badge/badge.svg" alt="Join the Wasmer Community"></a>
<a href="https://rubygems.org/gems/wasmer">
<img src="https://img.shields.io/gem/v/wasmer.svg" alt="Gem"></a>
<a href="https://rubygems.org/gems/wasmer">
<img src="https://img.shields.io/gem/dt/wasmer.svg" alt="Number of gem downloads"></a>
<a href="https://github.com/wasmerio/wasmer/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg" alt="License"></a>
</p>

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.
# <img height="48" src="https://wasmer.io/static/icons/favicon-96x96.png" alt="Wasmer logo" valign="middle"> 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].

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
to install Rust][install-rust].

[Wasmer]: https://github.com/wasmerio/wasmer
[rust]: https://www.rust-lang.org/
[install-rust]: https://www.rust-lang.org/tools/install

# Install

Expand All @@ -30,20 +26,14 @@ To install the `wasmer` Ruby gem, just run this command in your shell:
$ gem install wasmer
```

**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].

[rust]: https://www.rust-lang.org/
[install-rust]: https://www.rust-lang.org/tools/install
[wasmer-gem]: https://rubygems.org/gems/wasmer

# 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]
Expand All @@ -52,8 +42,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:

Expand All @@ -72,7 +64,9 @@ $ ruby simple.rb
3
```

# API documentation
# Documentation

Browse Wasmer Ruby Gem docs at https://www.rubydoc.info/gems/wasmer/.

## The `Instance` class

Expand Down
2 changes: 1 addition & 1 deletion wasmer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 788946f

Please sign in to comment.