New JavaScript module using Google V8!
Hello everyone, and Happy New Year! I've been testing out some Google V8 embedding at home, and since I was at it I decided to try to port mod_spidermonkey to use Google V8 instead. A few years back this wasn't possible, since V8 wasn't thread safe - but this has changed, and it works as expected using isolates and lockers inside. RIght now I've ported everything to work as before, but using Google V8 instead of SpiderMonkey. I've tested some basic stuff, and it seems ok so far - but I do have quite some more testing I need to do. Also, the build system is not really completed yet, so some manual work is needed to compile everything. I've developed it on Windows, but it should be able to compile on Linux without any major issues (I will try that pretty soon as well). I'm guessing this would make JavaScript to be a little more efficient than today, however, I didn't really do any performance testing yet. Even though Lua is the recommended scripting language in FS, I think JS always will have quite some users, since it's more widely spread. One thing though, is that it currently lacks support for the "File" and "XML" object that is currently compiled in when you use mod_spidermonkey - besides that everything else should be the same. Is this project of interest for the FS community? For me this was just a way to get to use V8 in an environment I already knew, so as soon as I'm getting it a bit more complete (with a working build system at least) I'd be happy to give away the code - and hopefully replace mod_spidermonkey in the future. /Peter
There's a total of $400 bounty listed on the wiki <https://wiki.freeswitch.org/wiki/Bounty#mod_for_using_new_Javascript_V8_Engine>for V8. Anthony suggested matching the api to lua so that the cpp wrapper could be reused. -Avi
That's good news - the more interest the better :) About using the cpp wrapper - I thought it was easier to port the stuff from mod_spidermonkey. The problem is that the C++ integration in V8 is kind of messy (and not as straight forward as Lua), so I ended up writing a couple a base classes, which is then extended for the different JS classes, for instance Session, Event, FileIO etc. Main part of the code in these classes has been ported from the existing code in mod_spidermonkey - but modified to fit the V8 API (and cleaned up, refactored etc.) RIght now I would say the completion state (for a working code base) is about 95% - I mostly need more testing right now, and after that a working build system for both Linux and Windows. I will get back with more information later on - and if someone is inerested in helping with some testing, just contact me. /Peter 2013/12/31 Avi Marcus <avi@avimarcus.net>
There's a total of $400 bounty listed on the wiki <https://wiki.freeswitch.org/wiki/Bounty#mod_for_using_new_Javascript_V8_Engine>for V8. Anthony suggested matching the api to lua so that the cpp wrapper could be reused.
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Avi Marcus
-
Peter Olsson