This is something I had in mind ( pretty much the code::blocks approach ).
[...]
My drafts and a sort of working test that I have so far.
You should add something like a "C"
GetPlugin() global function which is exported and which returns
new YourPlugin. There are of course a hundred other ways to do it, this is just what I would do...
Also, I recommend that you build in some versioning and sanity checking functionality. This can be as easy as exporting a constant, or a function like
GetVersion() or something. Anything will do, but you should have a way of telling whether the plugin will send your application straight to hell - in that case, the application should refuse to load it.
Personally, I would also keep the header file near the source, but that is a matter of taste. In any case, think clearly about the filesystem layout
now and make any changes that you might make some day
now, because the less files you have, the less trouble you have.
External scripting is I think a way limited and slow. Though no doubt is easy for plugin writer and developer.
It really depends on what you want and what you need, and on who is your audience. If you expect your plugins being written by users who don't necessarily know a lot about programming, then Python may very well be a consideration (although I personally hate Python, it still has advantages you can't deny). On the other hand, if you expect your plugins to be written by professionals, then I'd recommend C++.
Inkscape effects are all Python or Perl scripts, Blender supports a large part of its functionality only through Python (almost all file import/exports are done that way, and many, many effects), Firefox extensions do everything using JavaScript... there are more examples that could be used as proof of concept that it works and that it is fast enough on today's hardware.
But generally, you are right. Scripting is of course at least 10-15 times slower than native code.
Doesn't code::block support some scripting capablities?
Yes, Code::Blocks supports AngelScript. But we still write plugins in C++. It is faster, and a plugin has more power (in fact, a plugin has the same capability as the main program).