Jump to content
  • Advertisement
Sign in to follow this  
PAndersson

Scripting Library compitable with C

This topic is 3119 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
I suspect most would be, given that C is the most common choice for inter language communication and library interfaces. I know Lua, Ruby and Python are compatible, there are probably bindings from some javascript implementations to C.

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
there are probably bindings from some javascript implementations to C.
SquirrelFish (formerly WebScriptCore), the javascript engine used in Safari, has a C API.

Share this post


Link to post
Share on other sites
SpiderMonkey (javascript engine used in Firefox) is also written C and provides a nice C interface for embedding. javascript engines are a good choice currently because they are well tested, heavily optimized and in active development.

Share this post


Link to post
Share on other sites
So is Lua, and it's been used by many big-name games over the years. Why would you pick JS instead?

Seriously, why? I don't know JS well enough to evaluate the relative merits.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
So is Lua, and it's been used by many big-name games over the years. Why would you pick JS instead? Seriously, why? I don't know JS well enough to evaluate the relative merits.
No good reason, unless you have some investment in javascript. However, the improvements in javascript interpreter performance over the last couple of years make it a very viable choice, and if you intend to expose your scripting language to the artists and designers, a lot of people have existing javascript/actionscript experience.

As I understand it, the cutting edge builds of V8/Trace Monkey/SquirrelFish Extreme all beat plain Lua on speed (in some cases by considerable margins), but LuaJIT is far and away the best performing scripting language I have seen benchmarks for.

Share this post


Link to post
Share on other sites
javascript the language is actually pretty neat (most of the time, when people say "javascript sucks" they're actually talking about the DOM and interaction with the browsers). I don't know how easy something like SpiderMonkey would be to integrate into a game, though, because Lua is dead simple...

Share this post


Link to post
Share on other sites
Quote:
Original post by Codeka
I don't know how easy something like SpiderMonkey would be to integrate into a game, though, because Lua is dead simple...
For SpiderMonkey there is Flusspferd, which despite the crazy name, is ridiculously simple to use - arguably easier than luabind, et al. Several similar tools exist for V8 as well, though sadly nothing yet for SquirrelFish.

However, and this may be the bigget factor to some developers, all of the javascript interpreters weigh in a lot heavier than Lua (megabytes more, in some cases). That plus the performance advantages of LuaJIT, still keeps javascript a second class citizen in my view...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!