I went around writing a small IRC structure in C, which I am going to expand with some basic functions, but I would also like it to be extensible with plugins!
Until now, when I wrote something related to IRC (and I wrote a lot, in about 6 different languages โโnow ... I'm on fire!) And actually went ahead to implement the plugin architecture, it was inside (read: abuse), so that like clogging up the entire script file of the eval file in Ruby (bad!).
Now I want to abuse something in C!
Basically I could do three things
- define a simple script language inside my program
- use an existing one by embedding an interpreter
- use libdl to load * .so modules at runtime
I am addicted to the third, and if possible, avoid the other two options. Maybe I'm some kind of masochist, but I think it can be fun and useful for educational purposes.
Logical thinking, the obvious โchain of painโ will be (from low to high) 2 โ 1 โ 3, for the simple reason that libdl deals with raw code that can (and will) explode on my face more often than not.
So this question is right for you, other stackoverflow users, do you think libdl is appropriate for this task, or even a realistic thought?
c plugins
Luken
source share