The usual way is to expose some CLI commands and allow users to use them in whatever shell/script language user writes; see f.e. imagemagick
, which exposes a number of commands to convert images between formats and apply transformations. This works well in any OS.
This can also work with interactive programs, although it is rare. You can use D-BUS interface (which gets more and more popular in both GNOME and KDE), although it is more for processing events or sending simple commands. You might want to make an interactive or daemon-like program which exposes D-BUS (or even simple socket/pipe-based) interface, plus some simple CLI calls that wraps sending commands so that the interface is much simpler. See moc
/mocp
("Music On Console Player") or xmms2
. This works well in any OS, but usually needs some time to work out implementation details on different OSes.
Do not fear embedding a full language. Languages like Lua
or Guile
were designed so that they are very simple to embed and pretty powerful. Standarizing on one such language is not always a bad thing, as this means more code reusability between users... and the language actually matters only if you plan users to write big pieces of code as plugins.
There are some ways to expose API to several scripting languages using special libraries. You can read about them f.e. here: Kross@Wikipedia. I have no experience with them.
I assume that your program will be closed-source... Then last option I can see is to expose some kind of API/ABI interface which can be used by users' C programs (f.e. compiled to dynamic library). This way users will be able to make wrappers for any language they want, plus they can make code in plain C for speed. This solution might be difficult to make portable, but it gives you (and your users) flexibility.
Note that it is easy to overdesign scriptability: it is better to leave programming constructs to external languages, and only provide simple means of interaction with your program. I have seen programs which added their own looping facilities to a scripting languages, even though they didn't add any value to user: f.e. ability to pass multiple images to convert at once, even though it didn't make processing faster.