|resources:||Bugs Mailing List Source Code Sidebar|
Frequently Asked Questions
Why Use This Bridge? or What Is So Great About SpiderMonkey?
Let us first acknowledge the other great scripting products out there. Products such as Innerfuse Pascal Script by Carlo Kok; PaxScript by Alexander Baranovsky (which supports multiple scripting languages); Delphi Web Script, and others.
The reason SpiderMonkey is a good choice is due to its stability. It is the oldest, most heavily tuned engine available. It is also supported by dozens of engineers in the open source community. The Mozilla Foundation releases new versions of the engine regularly which improve speed, reliability, and conformability to the ECMA-262 Edition 3 standard.
Is The Delphi Code Stable? This is, of course, use-at-your-own-risk code, but before each public release the code is tested using a performance tuner and memory leak evaluator. Unfortunately we can't certify the code or provide any guarantees as to its reliability. We can only tell you that we would use each release in our own applications.
What Classes Are Available And How Do They Help Me? There are several classes included in this package, designed to integrate Delphi and SpiderMonkey as tightly as possible. These are:
All script interactivity begins with this component and all of the other classes depend on it. If your application is multithreaded, you'll create a new instance of
TJSEnginefor each thread.
This class is intended to extend existing
TObjectdescendents (or classes with no explicit inheritance) with instant script interactivity. Declare any Delphi object as a descendent of
TJSBridge, publish all the properties and methods you want scriptable and then connect it to a
Most of your Delphi-to-script code will deal with
TJSString, except as a floating point number.
TJSStringbut now the value is a boolean.
This class is still in the beta stage. If you can help stabilize it, please do so. In the meantime, play with it, but don't depend your application on it.
This class is listed last because it's kinda flaky. A
TJSFunctionis not retrievable when it goes out of scope. You may create one, but the
TJSFunctioninstance can not be recovered by another scope. The good news is your function will not disappear - it remains callable from the scope you specified, it's only the
TJSFunctioninstance that gets "lost".
What Support Options Do I Have? Since this is a free-time-only project we don't have plans to spend a lot of time helping people out. At the same time, if you post to the mailing list we'll do our best to help.
What Compilers Does The Bridge Work With? The bridge code works with Borland Delphi and Borland Kylix. We are working on FreePascal support and hope to be fully compatible soon (requires a 1.9.x compiler).
What Platforms Does The Bridge Work On? The bridge code presently works on Windows and Linux. If Borland ever ports Delphi to another platform then it's very likely that this code will work there as well. We are working on FreePascal support which will add several additional platforms.
How Do I Start?
Start by including the path to the bridge classes in your IDE's Library Path.
(Tools | Environment Options | Library | Library Path) If you are using Windows, you will need
JS3215R.DLL in your Windows' Search Path or the directory
where your application is run. Linux users will need
libjs.so in their path or their
application directory. To use the classes in a unit, you need to include
jsintf in the
uses clause. See the documentation on the bridge classes to understand what's available.