ruby-v8 icon indicating copy to clipboard operation
ruby-v8 copied to clipboard

Run the V8 Javascript Engine from Ruby.

h1. V8 for Ruby

Run the V8 Javascript Engine from Ruby. V8 is Google's powerful JS engine that's used by Google Chrome. Using this C++ Ruby extension, you can run JS from Ruby land.

Note: this project just started, there is a lot to be done. There is no way that this code is production ready yet.

h2. Install


  # Download and build V8: http://code.google.com/apis/v8/build.html
  # Change to your ruby-v8 directory.
  # Need Ruby RICE to pimp up C++ compatibility:
  sudo gem install rice
  # Compile the V8 ruby module:
  ruby extconf.rb --with-v8-dir=$V8_BUILD_PATH

h2. Example: Hello World


  require 'V8'

  js_code = 

h2. TODO

  • Proper exception handling
  • Memory benchmarking, making sure things are garbage collected
  • Ruby function and object callbacks