Saturday, October 11, 2008

V8 - Lua - V8 - Lua

My mind being trowing between the V8 javascript and lua scripting language, which one should i used for my super duper simple 3d engine?

the advantage of V8 javascript:
1) backed by google,
2) faster than native lua
3) designed to be embeded
4) sandbox design,
5) huge user base from Web and flash

the advantage of lua
1) small and simple
2) api are lower level than V8
3) Lua JIT is faster than javascript

ping-pong my mind between this two scripting, read many v8 scripting vm review, most of the people said it is easier embed v8 to c++ than lua and it is faster.
see this http://blogs.bungeeconnect.com/2008/10/09/connecting-c-to-javascript-via-googles-v8/ for great introduction how to access javascript functions from c++

finally i decided to test run v8 javascript. i immediately run into problem. a suppose to be trivial problem, how to compile an external javascript? most of the example compile string, not by file. shocking google did very bad job in documentation. can't find this simple information in the entire internet.

disappointed, ya lua's api maybe more c-like, bad comment syntax, 1-based index blah blah, but when come to documentation it is much better compare to V8. so my verdict is out, concentrate on Lua first, two to three yeah later check again javascript, by the time tracemonkey and squirrelfish should be out, the documentation of them should be better than current state.

No comments: