A couple of comments on the scripting issue:

JavaScript is a really nice language, but you aren't going to get a very small runtime without losing useful things (like regular expressions). However, the sources are readily available, as has already been noted. My day job is working with Mozilla based products, and more than 1/2 our application logic is written in JS (pretty much all the UI and glue logic) JS is very effective and manageable, orders of magnitude moreso than Perl. Python is equally good as the code size grows, but the syntax puts people off and the common library is huge as Norman (I think?) already pointed out.. JS doesn't have a common library in the same way.

Anyway, you can't (easily) leverage the JS runtime that ships with Mozilla, it's been subtly tweaked for Mozilla integration, and is often a not-quite-release version. It is technically possible to use the runtime, but I would strongly recommend not bothering to try, since it will introduce many complications. For one thing, it's sitting in a strange place: the Mozilla non-XPCOM shared object directory, which will be something like /usr/lib/mozilla, /opt/mozilla or possibly /opt/gnome/lib/mozilla (under Ximian). Should the user have a static Mozilla build (I don't know if this is ever going to happen in practice, but it keeps getting talked about) there won't even be a shared object to link to.

In terms of embedding a really small interpreter, I know various people who've used Lua with great success (it seems designed to be inlined into a 'host' source tree and modified, not kept distinct), and it's really, really small. Never used it personally, but worth investigation if disk size is the primary consideration. Also, the dependency issues go away (in the projects I know that have added Lua, there has never been a support issue related to it)

One final point : everything I've heard about SWIG indicates that it handles OO systems badly: it maps straight C to Perl/Tcl/etc well, but when you want to map classes to Java / Python / JS, it falls down pretty quickly. When I embedded Python in some of my own code, I tried using SWIG briefly, gave up, and was able to use the native Python API far more effectively.

Sorry this drifted rather far OT, all just my 2 pence, of course.
James

Reply via email to