Over at stackoverflow someone
asked<http://stackoverflow.com/questions/4913178/javascript-in-delphi-applications>, "Is it possible to utilize javascript in the making of windows desktop applications". I wrote up a pascal based solution to add javascript access to your desktop programs. If you have any interest in my solution you can view it here (source code included):
Mailing lists / fpc-pascal / 2011-02
Javascript in Desktop Applications
10 messages · 7 people · –
- AAndrew Brunner 3
- UUnknown author 2
- AAnthony Walter 1
- BBenjamin Rosseaux 1
- BBrian Winfrey 1
- MMichael Van Canneyt 1
- +1 more
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Anthony Walter wrote 9 lines
A cross-platform solution is to use one of libsee or BESEN.
The latter is implemented in 100% native Object Pascal.
Michael.
Show quoted text 5 lines
BESEN is very, very, very well written but I can't seem to get any indication how to use it in my project. I would love FPC to include a JIT system for JS or Pascal. IMO, FPC absolutely needs a scripting FCL going forward. BESEN seems like the right guy for the job, but I suspect he's burned out :-( I think he had memory concerns too.
Does anyone have any BESEN examples that integrated actual FPC units? It seems like all the samle js units are self contained with no interface to system or GUI units.
Including JS support on my project would enable people to leverage exiting "proven" technologies which would make for easier/allowable for adoption in working groups / houses where selection of language is restricted to language of the day :-) Taking this statment and applying this across the board, it would be an easier sell for adoption of FPC/Lazarus with JIT support. Personally, I'm thinking along the lines of Web RAD down the road...
Andrew Brunner wrote 26 lines
Well, if you can't get BESEN to work, libsee definitely does. I even have an article on how to do it.
Michael.
Show quoted text 40 lines
I have some interest in exploring javascript implementations for fpc. http://code.google.com/p/fpcjs/ -- Is this comparable to what you have noted?
Brian Winfrey wrote 12 lines
No, that project embeds mozilla in FPC.
Michael.
I have some interest in exploring javascript implementations for fpc.…
Brian Winfrey wroteI have some interest in exploring javascript implementations for fpc. http://code.google.com/p/fpcjs/ -- Is this comparable to what you have noted?
Actually fpcjs is the first project that I, (myself), have seen that addresses the gateway issue of accessing application level methods. Granted fcpjs (currently) only supports one type of callback(variant array):variant. The only issue I see is having a quasi fpc/js design restriction in developing apps with no OOP - coding low-level linear methods(for register) with maps to JS object counterparts. The other MAJOR issue is that callbacks via Register are not working on Linux !?!. Docs said they needed something about native registration. But this project looks lightweight enough on its face.
I'm at a point in my project where I think I am needing something like this. In an ideal world, any application level scripting engine should know how to interface with FPC objects @ runtime w/o variants.
Currently, my largest problem is because without things like scripting :
* Admins must rebuild the service exe every time back-end objects are modified.
* Production environments where each binary is installed on a different device across the network cluster(s)/node(s) will have different versions.
* Auto-build or auto-updates via distribution system will most likely lead to problems for either us or for Admins during deployment.
The use of a scripting engine would resolve these problems.
No, that project embeds mozilla in FPC. Michael.
Hmmm... Mozilla is open source... :-) We are free to port the Scripting Engine to Pascal as long as we have the source? no?
Michael Van Canneyt wroteNo, that project embeds mozilla in FPC.
BESEN is very, very, very well written but I can't seem to get any indication how to use…
Andrew Brunner wroteDoes anyone have any BESEN examples that integrated actual FPC units? It seems like all the samle js units are self contained with no interface to system or GUI units.
I haven't looked at the source in general and I also haven't tested it yet, but take a in BESEN.pas and
TBESENNativeObject in BESENNativeObject.pas. TBESENNativeObject utilizes RTTI, so this seems to be the way to access native code. You might need to inherit from that class and provide published methods/properties for the native code you want to use.
Regards,
Sven
BESEN is very, very, very well written but I can't seem to get any indication how to use…
Andrew Brunner wrote 26 lines
Have you looked at the BESENShell.dpr/BESENShell.lpr? Because that contains the most important part, how you can integrate own API stuff. And the last commit to the BESEN SVN was just a few days ago with a few weeks pause, because I've found no bugs and got no bugreports in that time.
Benjamin 'BeRo' Rosseaux
