<p>I'm looking at adding scripting functionality to an existing codebase and am weighing up the pros/cons of various packages. Lua is probably the most obvious choice, but I was wondering if people have any other suggestions based on their experience.</p>

<p>Scripts will be triggered upon certain events and may stay resident for a period of time. For example upon startup a script may define several options which the program presents to the user as a number of buttons. Upon selecting one of these buttons the program will notify the script where further events may occur.</p>

<p>These are the only real requirements;</p>

<ol>
<li>Must be a cross-platform library that is compilable from source</li>
<li>Scripts must be able to call registered code-side functions</li>
<li>Code must be able to call script-side functions</li>
<li>Be used within a C/C++ codebase.</li>
</ol>

I have played around a little bit with
Spidermonkey
. It seems like it would at least be worth a look at in your situation. I have heard good things about Lua as well. The big argument for using a javascript scripting language is that a lot of developers know it already and would probably be more comfortable from the get go, whereas Lua most likely would have a bit of a learning curve.
I'm not completely positive but I think that spidermonkey your 4 requirements.