README.md in h8-0.0.2 vs README.md in h8-0.0.4
- old
+ new
@@ -1,9 +1,10 @@
# Hybrid8, aka H8
-_Warning_ this gem has yet limited functionality and is under main development. Versions suitable
-for an open beta test will start from 0.1.*.
+_Warning_ this gem functionality is almost complete but it lacks of testing and some features
+(see below). This is a working (or better say, test passing) alpha. Beta suitable versions
+will start from 0.1.*.
Therubyracer gem alternative to effectively work with ruby 2.1+ in multithreaded environment in an
effective and GC-safe way. Should be out of the box replacement for most scenarios.
Special features:
@@ -14,17 +15,67 @@
- care about wrapped Javascript objects lifetime the same. Referenced JS items will not be recycled
while there are ruby objects referencing it. It also means that once created H8::Context will not
be reclaimed as long as there is at least one active wrapped object returned from the script.
+- you can pass ruby objects from ruby code called from javascript back to the ruby code intact.
+Ruby objects are automatically wrapped in js code and unwrapped in ruby code (you might need to
+call #to_ruby)
+
+- Uncaught ruby exceptions are thrown as javascript exceptions in javascript code. The same,
+uncaught javascript exceptions raise ruby error in ruby code.
+
+## Main difference from therubyracer/features not ready
+
+*This version is not (yet?) thread safe*. For the sake of effectiveness, do not access same
+H8::Context and its returned values from concurrent threads. Use Mutexes!
+
+- correct and accurate object tracking in both JS and Ruby VMs, GC aware.
+
+- passed thru objects and exceptions in js -> ruby -> js -> ruby chains are usually kept unchanged,
+e.g. wrapped in one language then unwrapped when passed to the original language
+
+- Not Yet: source information in uncaught exception in js
+
+- Script is executed in the calling ruby thread without unblocking it (for the sake of
+effectiveness). If we would release GIL and reacquire it, it would take more time. And there is no
+multithreading support yet (this one might be added soon).
+
## Installation
### Prerequisites
You should have installed libv8, use latest version with v8::Isolate and v8::Locker. This version
may not find you installation, contact me if you have problems, I'll tune it up.
+#### Macos (10.9 maybe+)
+
+The working process:
+
+install v8 from sources 3.31.77 (or try newer), then execute:
+
+ gclient update
+ export CXXFLAGS='-std=c++11 -stdlib=libc++ -mmacosx-version-min=10.9'
+ export LDFLAGS=-lc++
+ make native
+ exportexport V8_3_31_ROOT=`pwd` # or somehow else set it
+
+Note that exporting symbols is a hack that may not be in need anymore. After that the gem should
+install normally.
+
+#### Debian and like
+
+Install first a valid v8 version. We provide a ready package!
+
+ sudo apt-get install libv8-3.31-dev
+
+It should install prerequisites, if not, manually install
+
+ sudo apt-get install libicu-dev
+
+You might also need to install GMP.
+
### Setting up
Add this line to your application's Gemfile:
gem 'hybrid8'
@@ -91,5 +142,7 @@
1. Fork it ( https://github.com/[my-github-username]/hybrid8/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
+
+