
Ted Gould wrote:
I think that we're going to have to have a C DOM interface in the end. I think it would probably be easier to implement that as C++ internally, but as far as linking to other interpreters or languages, most like C better. But, ofcourse, first one to implement wins :)
As far as SWIG goes, we've talked about it alot, but I don't think that anyone is currently working on it. If you wanted to implement Python via SWIG that might be cool, as it would allow other languages to play along also.
I was one working on it, but can't actually code at the moment.
I'm on an ancient RH 8.0 system. Once I get this new HD sitting on the table over there installed and get RH 9.0 installed, I'll be able to catch back up to current code.
However... I've done a lot of analysis.
SWIG allows C++ programs to expose objects and innards to an arbitrary set of language bindings.
SWIG provides a mechanism for *how* to bind C++ to different languages. But not really anything about *what* to bind. Just define what C++ to expose and let SWIG do the heavy lifting of all the language specific binding. Since you get multiple languages for a single config I believe that SWIG gives us some of the most bang for our buck as far as binding goes.
But for the *what* to bind... enter DOM and it's friends (DOM Events, XPath, SVG DOM and some assorted other things like SMIL, XForms, etc).
The W3C has done some decent work here. We can use their IDL's and language bindings to tell us *what* our API should look like.
Here's a quick rundown on the interfaces/bindings that should be considered (add to this list as needed guys):
* DOM http://www.w3.org/TR/DOM-Level-2-Core/ - IDL http://www.w3.org/TR/DOM-Level-2-Core/idl-definitions.html - Java http://www.w3.org/TR/DOM-Level-2-Core/java-binding.html - ECMAScript http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html
* SVG DOM http://www.w3.org/TR/SVG/svgdom.html - IDL http://www.w3.org/TR/SVG/idl.html - Java http://www.w3.org/TR/SVG/java.html - ECMAScript http://www.w3.org/TR/SVG/escript.html
* DOM Level 2 Events http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ - IDL http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/idl-definitions.ht... - Java http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/java-binding.html - ECMAScript http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ecma-script-bindin...
* DOM Level 3 Events http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/ - IDL http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/idl-definitions.h... - Java http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/java-binding.html - ECMAScript http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/ecma-script-bindi...
* XPath http://www.w3.org/TR/1999/REC-xpath-19991116
* XForms http://www.w3.org/TR/2003/REC-xforms-20031014
* SMIL 1.0 http://www.w3.org/TR/1998/REC-smil-19980615
* SMIL 2.0 http://www.w3.org/TR/2001/REC-smil20-20010807
One thing I found is that the more you read (including the different language bindings defined... Java & ECMAScript for example) the better you can understand how to leverage things simply and with the most power. Read them all, then code a subset. :-)
Oh, and XPath can be a powerful little scripting language itself.