[fpc-devel] (no subject)

L L at z505.com
Mon Jun 18 08:00:22 CEST 2007


> Why do you need a plug in mechanism? You've the sources? When you
> have the sources, 90 per cent of the use of a plugin are gone.

>> Well, we'd call that non-intrusive change. ;)
>>
>> You'd just need to compile the plug-in, and not a changed compiler
>> (which then may even apply recursively). This rules out a whole class
>> of possible error sources.
>>
>> So it's probably the last 10% that counts. ;) Which, BTW, fits nicely
>> into another 90/10 rule: 90% of all errors are coming from only 10% of
>> the code. ;)

Absolutely agree here, plug-ins are most useful even in open source.. compilers plug-in system right
now is the FPC.CFG file. Some people don't see this as a plug-in but it is. Imagine if you had to
recompile the fpc compiler each time you wanted to change the search paths.

That being said, a monolithic single exe compiler is okay - I think plugins are more useful in
larger programs with lots of component stuff, like web sites and gui programs, and certain console
programs that grow large enough. I have many rants about this on PasWiki, as some of you may have
come across - why I personally find that plug in systems are still important even if you have the
source.

Biggest advantage of plug-in:
If someone writes shitty code, uninstall the plug-in. People write shitty code, even the best of
programmers. Easier to debug shitty code when it is inside a plugin and not in the main executable.

There are issues with plug in systems and they aren't the holy grail, such as DLL hell or reliances
or speed issues (loading plugins for compiler could be slow, but in GUI apps or certain console apps
there is no need to worry).

I find also that plug in systems encourage good engineering. If a program has a good plug-in API
then the API was engineered well - algorithms weren't just slapped in units (or on a form) and
recompiled. Someone had to think hard about the engineering and actually design the program it to be
extensible. It's not a solution for quicky RAD apps, it's a long term thing for larger projects.

An operating system is a plug-in system. Elf's and Exe's are plugins. No one thinks of them like
plug-ins, but they are. HTML files are plugins too. Imagine if we had to recompile the operating
system each time we wanted to install a new program? Hey, the kernel is open source - just add more
code to the bottom of the kernel.c file and add your program... no way, thanks.

Lars




More information about the fpc-devel mailing list