Several people have asked me to let them know if there is anything they can do to help out toward DOM scripting. I came across something today that would be of excellent help.
It is quite possible that ActionScript might turn out to be a much better fit than Spidermonkey as our JS engine, since it is C++ and we would be able to use C++ inheritance rather than Spidermonkey's C bindings, which are hard to understand, convoluted, and incredibly verbose.
We would need to test this out first, however, to make sure that it is feasible and worth the effort.
What we would need is a MinGW build of ActionScript. The free Mozilla version of this is called Tamarin, and is available at: http://www.mozilla.org/projects/tamarin/
The code can be checked out via cvs: cvs -d :pserver:anonymous@...1680...:/cvsroot co mozilla/js/tamarin
The problems I found are mostly these:
1. there are a lot of _asm{} chunks distributed through the code, and when they include a chunk with #ifdef WIN32, they assume that you are using MSVC. What they really need is to split their #ifdefs for win32 to _MSC_VER and __MINGW32__. MinGW needs to use the same asm code as the linux-ia32 pieces.
2. setjmp in mingw is defined as a macro, so when they wrap that in a macro later, there is a problem
3. GrowableBuffer has some Intel asm in one place, but -no- gcc asm version. Someone needs to write the 10 lines gcc-style.
There are others. If the hacks are clean, we could help out the Mozilla guys by sending them a patch. They could use this for Linux, too.
So if people are really serious about helping out with scripting, this is a good place to start. Thanks.
bob
Hi again.
Well, after attempting to compile it over the weekend, I've come to the conclusion that even though ActionScript might be superior for our needs than Spidermonkey, it is just not ready for cross-platform, thus not ready for Inkscape.
So... sorry about the big commit, but I upgraded Spidermonkey to version 1.6 (has the new JS XML API). This is so that we can move forward with a fresh version.
I tried building with this before the commit, no problems. If anyone sees any problems, please let me know.
I think that JS-binding will accelerate in the next few days, and that we will have a lot of fun with it.
bob
On Mon, Mar 05, 2007 at 04:42:12AM -0600, Bob Jamison wrote:
So... sorry about the big commit, but I upgraded Spidermonkey to version 1.6 (has the new JS XML API). This is so that we can move forward with a fresh version.
Isn't spidermonkey an external project/library? i.e. can we use it without importing its code base into inkscape?
I think that JS-binding will accelerate in the next few days, and that we will have a lot of fun with it.
This is very exciting! (Though also scary, given all the DOM problems firefox has had recently.)
On Mon, 2007-03-05 at 07:45 -0800, Kees Cook wrote:
On Mon, Mar 05, 2007 at 04:42:12AM -0600, Bob Jamison wrote:
So... sorry about the big commit, but I upgraded Spidermonkey to version 1.6 (has the new JS XML API). This is so that we can move forward with a fresh version.
Isn't spidermonkey an external project/library? i.e. can we use it without importing its code base into inkscape?
I think that JS-binding will accelerate in the next few days, and that we will have a lot of fun with it.
This is very exciting! (Though also scary, given all the DOM problems firefox has had recently.)
Yes, true...we could just use SVN externals if they are using SVN, right? Seems like too much to bring in our own copy into our codebase...
Jon
participants (3)
-
Bob Jamison
-
Jon Phillips
-
Kees Cook