Jump to content

How to change javascript engine to V8 ?


Recommended Posts

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 replace

the 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...