Binding the SpiderMonkey API to .Net
An object of my admiration recently has been the SpiderMonkey engine and it's API. SpiderMonkey is the very vessel for the invention of JavaScript, by Brendan Eich. It's being used in several bleeding edge open source projects right now, and most notably it remains the JavaScript implementation of FireFox. I had been experimenting with SpiderMonkey in a C++ side project, proving its customizability to myself. And it is-- for instance SpiderMonkey does not contain an HTML DOM implementation. That API is elsewhere in the FireFox source (haven't read it yet), extending core JavaScript.
The problem is I would like to utilize C# in implementing a scriptable application. So what I'm developing now is a SpiderMonkey binding for .Net. I wrote a code generator to produce the new C# function definitions, and many are untested. I will have to port some of the C macros in SpiderMonkey over, only a small number of these are done. Finally, I suspect a layer of helper functions is needed, to abstract some of the dirty interop details involved in using this solution. However, all of my original C++ code is now working in C#, so the binding seems like a workable solution and worthy of a post.
The required reading in SpiderMonkey customization is by Software At Work. The example object built there is a
The problem is I would like to utilize C# in implementing a scriptable application. So what I'm developing now is a SpiderMonkey binding for .Net. I wrote a code generator to produce the new C# function definitions, and many are untested. I will have to port some of the C macros in SpiderMonkey over, only a small number of these are done. Finally, I suspect a layer of helper functions is needed, to abstract some of the dirty interop details involved in using this solution. However, all of my original C++ code is now working in C#, so the binding seems like a workable solution and worthy of a post.
The required reading in SpiderMonkey customization is by Software At Work. The example object built there is a
Customer, which you find as a C# implementation here (VS8 project). It will require you to drop in jsapi.dll with the binary.
2 Comments:
Great work Mr.Praxis! I've been looking for the way to use SpiderMonkey in C#.
Thanx a lot.
Thanks!!!
it really helps a lot!
Post a Comment
Links to this post:
Create a Link
<< Home