4 ms·
Embedding Rhino
- jm4 18y agoRhino is very cool, but the documentation is horribly lacking. There are a couple tutorials on the Mozilla site. I believe this is the better one. It's enough to get you started, but anything even remotely complex is going to require lots of trial and error. There are also quite a few little gotchas that you're left to figure out on your own. One that comes to mind as I skim through that tutorial has to do with the jsGet_ and jsSet_ methods used for implementing dynamic properties. You must implement both of them even if you only intend to use one. If you only implement the jsSet_ method it will mysteriously and silently fail. As soon as you add a corresponding jsGet_ method it magically works. Don't forget about SpiderMonkey- http://www.mozilla.org/js/spidermonkey/ http://www.mozilla.org/js/spidermonkey/. It's the C version and if I remember correctly people have already created modules in the cool scripting languages to easily embed it.
- dhotson 18y agoOh thanks for the tip. A quick search revealed this: http://code.google.com/p/ruby-spidermonkey http://code.google.com/p/ruby-spidermonkey Niice! :)