Crates.io | helix |
lib.rs | helix |
version | 0.7.5 |
source | src |
created_at | 2017-03-14 10:12:35.50426 |
updated_at | 2018-06-04 20:19:55.5058 |
description | Embed Rust in your Ruby |
homepage | https://usehelix.com |
repository | https://github.com/tildeio/helix |
max_upload_size | |
id | 8973 |
size | 75,431 |
Helix allows you to write Ruby classes in Rust without having to write the glue code yourself.
ruby! {
class Console {
def log(string: String) {
println!("LOG: {}", string);
}
}
}
$ rake build
$ bundle exec irb
>> require "console"
>> Console.log("I'm in your Rust")
LOG: I'm in your Rust
=> nil
Read the Introducing Helix blog post for a quick introduction to the project!
https://usehelix.com/getting_started
Helix has been tested with the following, though other combinations may also work.
If you'd like to experiment with Helix, you can start with some of the examples in this repository.
Clone and download the Helix repository:
$ git clone https://github.com/tildeio/helix
$ cd helix
Navigate to the console example folder and bundle your Gemfile
:
$ cd examples/console
$ bundle install
Run rake irb
to build and start irb:
$ bundle exec rake irb
Try running some of the methods defined in examples/console/src/lib.rs
:
> c = Console.new
Console { helix: VALUE(0x7fdacc19a6a0) }
=>
> c.hello
hello
=> nil
> c.loglog('hello', 'world')
hello world
=> nil