Scripting Languages

So I want to add a macro/scripting language to PN2. I have evaluated a number of alternative paths that I can take and now I want your feedback!

I looked at a number of scripting language and extension mechanism implementations available for C/C++. I then discarded most of them because of one of a number of reasons:

Languages/Mechanisms I discounted: Perl, TCL, REXX, Ruby, MS Active Scripting, LUA

The two choices that I have in mind are:

Python is an option because it’s a language that I have grown to love and it comes with batteries included (meaning lots of useful libraries straight out-of-the-box). There are also a number of good ways to embed Python in C/C++ (although I have concerns). JavaScript I chose because it’s a well known language with large numbers of resources explaining how the language works. The SpiderMonkey implementation is very easy to embed and is fairly lightweight (400k).

Using Python as the default scripting language would require users to download Python to be able to run/create scripts. This is a 10+ megabyte download needed to benefit from scripting. This is quite a requirement. My concerns with embedding Python relate to the fact that you need to link to a certain version of the python library. Users would need to have the correct version of python installed to be able to use the integration. This could possibly be avoided through the creation of a dynamic-linking library for python embedding.

Using JavaScript as the default scripting language would allow distribution with PN adding perhaps 1 megabyte at most to the distribution. JavaScript doesn’t, however, come with much. Basic provisions are Array, Boolean, Date, Math, Number, RegEx and String. With these primitives, I can provide a good OO interface into PN allowing for lots of scripting goodness, but I can’t provide complicated things like the libraries of Python provide. This would really be a Macro system for PN rather than integration with a scripting environment.

Of course, the last alternative is to define a C/C++ extension mechanism to PN that allows the use of both (and potentially others). Provide a simple JS mechanism for macros and scripting out-of-the-box but also provide an optional Python extension that allows the use of Python for those that desire it.

So dear users, it is your time to influence my decision. Which of the above would you prefer, or do you (greedy user) want both?! Have I forgotton “your favourite scripting language (tm)” and you think I really ought to evaluate it before carrying on with my current crazyness? Get in touch!

Leave comments with your thoughts.