Scripting Library compitable with C

Started by
12 comments, last by AverageJoeSSU 14 years, 1 month ago
Hey all, I'm wondering if you are aware of any scripting libraries that are compatible with C?
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 &#106avascript implementations to C.
Quote:Original post by rip-off
there are probably bindings from some &#106avascript implementations to C.<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE-->SquirrelFish (formerly WebScriptCore), the &#106avascript engine used in Safari, has a C API.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

SpiderMonkey (&#106avascript engine used in Firefox) is also written C and provides a nice C interface for embedding. &#106avascript engines are a good choice currently because they are well tested, heavily optimized and in active development.
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.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
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 &#106avascript. However, the improvements in &#106avascript 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 &#106avascript/actionscript experience.<br><br>As I understand it, the cutting edge builds of V8/Trace Monkey/SquirrelFish Extreme all beat plain Lua &#111;n speed (in some cases by considerable margins), but LuaJIT is far and away the best performing scripting language I have seen benchmarks for.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

&#106avascript the <em>language</em> is actually pretty neat (most of the time, when people say "&#106avascript 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...
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 &#106avascript interpreters weigh in a lot heavier than Lua (megabytes more, in some cases). That plus the performance advantages of LuaJIT, still keeps &#106avascript a second class citizen in my view...

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

One of the other reasons I prefer &#106avascript is <a href="http://doc.trolltech.com/4.5/qscriptenginedebugger.html">QScriptEngineDebugger</a>. In few lines of code you get a <a href="http://doc.trolltech.com/4.5/qtscriptdebugger-manual.html">visual debugger</a> (as part of your application) where you can set breakpoints, debug line by line and watch variables.<br>I have not come cross anything similar for Lua.
Decoda.
I only just discovered it myself in the last few days and haven't had the chance to try it out. But it seems to do everything I'd expect of a debugger.

This topic is closed to new replies.

Advertisement