Javascript in Desktop Applications

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript in Desktop Applications

Anthony Walter-3
Over at stackoverflow someone asked, "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):

http://www.codebot.org/delphi/?doc=9573

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

michael.vancanneyt


On Mon, 7 Feb 2011, Anthony Walter wrote:

> 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):
>
> http://www.codebot.org/delphi/?doc=9573
>

A cross-platform solution is to use one of libsee or BESEN.

The latter is implemented in 100% native Object Pascal.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Andrew Brunner
On Mon, Feb 7, 2011 at 7:35 AM,  <[hidden email]> wrote:
> A cross-platform solution is to use one of libsee or BESEN.
>
> The latter is implemented in 100% native Object Pascal.
>
> Michael.

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...
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

michael.vancanneyt


On Mon, 7 Feb 2011, Andrew Brunner wrote:

> On Mon, Feb 7, 2011 at 7:35 AM,  <[hidden email]> wrote:
>> A cross-platform solution is to use one of libsee or BESEN.
>>
>> The latter is implemented in 100% native Object Pascal.
>>
>> Michael.
>
> 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...

Well, if you can't get BESEN to work, libsee definitely does.
I even have an article on how to do it.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

bsquared
On Mon, Feb 7, 2011 at 6:27 AM,  <[hidden email]> wrote:

>
>
> On Mon, 7 Feb 2011, Andrew Brunner wrote:
>
>> On Mon, Feb 7, 2011 at 7:35 AM,  <[hidden email]> wrote:
>>>
>>> A cross-platform solution is to use one of libsee or BESEN.
>>>
>>> The latter is implemented in 100% native Object Pascal.
>>>
>>> Michael.
>>
>> 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...
>
> Well, if you can't get BESEN to work, libsee definitely does.
> I even have an article on how to do it.
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

I have some interest in exploring javascript implementations for fpc.
http://code.google.com/p/fpcjs/  -- Is this comparable to what you have noted?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Michael Van Canneyt


On Mon, 7 Feb 2011, Brian Winfrey wrote:

>>
>> Well, if you can't get BESEN to work, libsee definitely does.
>> I even have an article on how to do it.
>>
>> Michael.
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>
> I have some interest in exploring javascript implementations for fpc.
> http://code.google.com/p/fpcjs/  -- Is this comparable to what you have noted?
No, that project embeds mozilla in FPC.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Andrew Brunner
In reply to this post by bsquared
On Mon, Feb 7, 2011 at 10:39 AM, Brian Winfrey <[hidden email]> wrote:
>
> I 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Andrew Brunner
In reply to this post by Michael Van Canneyt
Hmmm...  Mozilla is open source... :-)  We are free to port the
Scripting Engine to Pascal as long as we have the source? no?

On Mon, Feb 7, 2011 at 11:31 AM, Michael Van Canneyt
<[hidden email]> wrote:
> No, that project embeds mozilla in FPC.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Sven Barth-2
In reply to this post by Andrew Brunner
Am 07.02.2011 15:16, schrieb Andrew Brunner:
> 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.

I haven't looked at the source in general and I also haven't tested it
yet, but take a look at TBESEN.RegisterNativeObject 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Javascript in Desktop Applications

Benjamin Rosseaux
In reply to this post by Andrew Brunner
Am 07.02.2011 15:16, schrieb Andrew Brunner:

> On Mon, Feb 7, 2011 at 7:35 AM,<[hidden email]>  wrote:
>> A cross-platform solution is to use one of libsee or BESEN.
>>
>> The latter is implemented in 100% native Object Pascal.
>>
>> Michael.
> 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...
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal