Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mustang - A Ruby interface to V8 (github.com/nu7hatch)
1 point by rb2k_ on July 17, 2011 | hide | past | favorite | 1 comment


The readme compares this to the ruby racer (https://github.com/cowboyd/therubyracer):

Similarities:

Both are using similar integration with ruby's garbage collector. Actually, Mustang's code which handles that references is just improved version of TheRubyRacer's code (check the ext/v8/v8_ref.cpp).

Both are reflecting JS objects to ruby and vice-versa.

Diffs:

Mustang reflects all JavaScript objects and values properly. Properly, means all values from within V8 are reflected to Mustang::V8::* objects, regarding V8 inheritance tree which you can find here.

Once reflected ruby object (and vice-versa) is always the same object in ruby world.

All reflected V8 objects acts exacltly the same as ruby natives. For example you can deal with Mustang::V8::Array exactly the same as with native Ruby arrays (eg. they are comparable with ruby objects, etc).

Functions are reflected more accurately. Ruby objects' methods are represented properly.

Classes are converted to V8 function templates, so you can deal with them as with prototypes.

Different approach to deal with contexts, compiling JS scripts and exceptions handling.

Support for regexp reflections.

Way more friendly ruby api.

A very thorough test suite (over 250 tests passing on all ruby versions)

Clean codebase, less magic, fully documented.

Lower memory usage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: