[fpc-devel] Dnamic packages support

L L at z505.com
Tue Nov 6 14:11:50 CET 2007


> Hi Lars,
>
> > The key point is exporting the api from the executable rather than the dll.
> > Many
> > people don't understand this basic concept nor know it is possible, nor
> > understand why it works and how it works.
> >
> I, too, in fact don't understand this. care to give a short explanation
> ? I do know about FP/GNU ABI-problems, but that does not seem to be the
> major port of the problem.

Executables can export functions and procedures just like a library can.

For delphi/fpc programs.. where most people design their software inside one
gigantic executable.. you already have an API stored in the exe. Taking all the
code out of the exe and putting it inside DLL's takes time. When you export some
procedures from the exe, you already have all that infrastructure in the exe
that you can use instantly. No taking code out from the exe and putting it in
dll's required.

Of course putting it into dll's is not a big deal if you have
compiler support that does all this automatically with the 'compile using
packages' checkbox. Exporting from the exe offers you the ability to quickly
make an API for language independent plugins that can work with Digital Mars D,
Freepascal, C, etc. 'Compile using packages' does not make the plugin system
language independent and portable too. I'm not sure if for example delphi
packages would ever dynamically load into an fpc executable. Whereas
plugger ones would.

So since your executable already contains lots of code in it..
And since turning an existing big Exe into DLL's is a big pain (without
compiler support), you can make use of the 'export from exe' trick that
people don't know about. People think dll's are what we can export things
from. Not only dll's but also exe's. This is the key to two way communication
between the dll and the exe, rather than one way communication.


> > LazarusRB (arby) demonstrated this years ago with an API called Plugger. It
is
> > no longer in active development
> That is a really bad :-( . What is LazarusRB ? Is there still something
> usable and some documentation on LazarusRB and/or Plugger ?
>

Not really, just some old videos and screenshots.
The problem for me is simply lack of time :-(


> > since I am very busy with web programming and
> > consulting, and documenting Powtils project which takes most of my time.
> P.S.:
> I did file a bug report regarding the in deed not functional
> "CGI-project" feature in Lazarus. I don't suppose that you are involved
> in that but maybe it would be a good idea to synchronize this with parts
> of what Powtils provides.

They have something called 'ezcgi' and 'cgimodule' which I guess you have
checked out?
But yes, more project integration is needed.. when I get fpcweb.exe working it
will work with any IDE such as lazarus/mseide but even more integration is
needed than just a http compiler. Things like a menu item to open a powtils
template/project is needed, and much more. There are many lazarus users using
Powtils and I had hoped one of them would create some template for the
'file-new..' dialog.  Amir wrote a lazarus plugin I think for O-PSP development
once:
https://opensvn.csie.org/pspcgi/LazarusPlugin/

L505




More information about the fpc-devel mailing list