aleReimondo Posted August 16, 2011 Report Share Posted August 16, 2011 Hi,I have a system running on top of javascript and V8 engine (the system use V8 features).I would like mount my system inside 0AD to perform some actions while playing the game...How much effort can be to make scripting engine use V8 ?(for a person with medium experience in V8 API, good experience in C++, zero experience in SpiderMonkey API)I have read the sources but didn´t find a thin layer to make me possible to replacethe scripting engine (nor plug other scprinting engine(s) ).Any information or guide on how to:1.- use v8 engine.2.- bind other scripting engines (diverse lang scripting).will be really appreciated!Ale. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted August 16, 2011 Report Share Posted August 16, 2011 The game is fairly tightly bound to details of the SpiderMonkey API, as well as using JS language features that only SpiderMonkey supports, so there's no realistic way to get rid of SpiderMonkey. Depending on what you want to achieve, it might be possible to just add V8 alongside SpiderMonkey, in which case it's basically the same as embedding V8 into any other C++ application. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 16, 2011 Report Share Posted August 16, 2011 Not sure which part of V8 you need, but if you've got scripts that depend on V8 features, would it be possible to just make wrappers for them? Then you wouldn't even have to touch the engine. Quote Link to comment Share on other sites More sharing options...
aleReimondo Posted August 17, 2011 Author Report Share Posted August 17, 2011 Thank you for your answers; do you mean that it is better to implement a wraper for scripting interface and replace the scripting (in runtime) by a wrapper that routes calls to v8 or spidermonkey ?Can this change be plugged during startup without modifying the sources of the system?It would be great if a plugin can be installed this way!How to install this "plugin"?(please any lines to guide me here)thanks in advance,Ale. Quote Link to comment Share on other sites More sharing options...
Chakakhan Posted August 17, 2011 Report Share Posted August 17, 2011 The SpiderMonkey and V8 APIs are too different to make them a "plugin" (without a huge development effort). All the API calls into JavaScript are different, the callback APIs are completely different, the Garbage collection mechanisms (rooting objects), etc. They are really very different.What historic_bruno was suggesting is that it might be easier to implement the missing v8 functionality you need in JavaScript and/or C++ so that it will run in the SpiderMonkey engine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.