How to code plugins?

BlitzMax Forums/BlitzMax Programming/How to code plugins?

ImaginaryHuman(Posted 2007) [#1]
What are the options, in BlitzMax code and cross-platform, for implementing some kind of plugin system? ie you release your app, someone else writes a plugin and somehow you app is able to `execute` it? I mean, is there a way other than to use scripting?


Jake L.(Posted 2007) [#2]
I would either use a scripting engine to execute plugins. Isn't there an open beta for a BMax-VM out?

Another way I can think of would be to dynamically bind DLLs.


Brucey(Posted 2007) [#3]
Something like libltdl would probably do the job *if* one was able to compile BlitzMax code in the required way...


ziggy(Posted 2007) [#4]
It will depend on what level of interaction you want your plug-in and your host application to have.

If the plug-in has a heavy interaction with your application and they have to interchange a lot of information quickly, the best way to go is using dynammic libraries. (like VSTs plug-ins)

If what you need is to expose a internal API to the plug-in developer, in order to let he or she improve or boost your application functionality, you could think on a scripting engine. (like Torque plug-ins)

If you don't spect to interchange a lot of information with the plug-in, you want your plug-in to be quick, and you want the plug-ins to be developed on native compilers for each platform, the best way is let the plugin be a standard executable with a comunications protocol to your app (using pipes). that's a fast a good x-platform plug-in system. This way you also protect your application from crashing when a plug-in is crashes. (like Rewire plug-ins)


Dreamora(Posted 2007) [#5]
Would as well suggest to either use DLLs with a given API they have to implement like most apps do (for importer, exporter, modifier plugins) or using a good enough known scripting language (LUA, Python) to write such plugins.