client <-> server interaction in C

Tapio Kelloniemi persistent.spam at thack.org
Tue Nov 22 14:27:18 PST 2005


On Tue, Nov 22, 2005 at 02:50:54PM -0700, Gerard Beekmans wrote:
 > Thomas Pegg wrote:
 > >I'm starting to lean towards C as the language, at the very least for 
 > >server/daemon side of things anyway.
 > 
 > What about the client part?

I would suggest a scripting language for the client part, if C is 
choosen for the server (assuming that we have a smart server and a dumb 
client). This way people can write their clients in C/Readline, Tcl/Tk, 
Python/GTK+ or whatever they want to see on their screens. But if the 
client is supposed to do something more complex than drawing menus and
sending messages like (build and install binutils, gcc, coreutils, 
...), then C should also be used for it. I would recommend dumb clients, 
since it allows stricter separation of the user interface and actual
building process (this way user interfaces become separate programs). Of
course the client needs to know the names of available packages and so on,
but this information can come from the server (recommended, since the server
best knows on which machine it is running) or from a local database, or
whatever.

What comes to the XML or NO discussion, I would suggest parsing the 
commands from the book (if, and only if this is possible cleanly and 
without hassle). I do not recommend XML since it is clumsy for humans to 
read and write. Shell scripts with M4 marcos is also an alternative 
(then we would have conditional execution, et al, without doing anything 
ourself). Autoconf has already succesfully choosen this approach (and 
for not so different task). Also I think that users should be free from 
XML which means that they should only need to edit easy configuration 
files (name=value), but preferably users can be presented with something 
like Linux's menuconfig (if it is appropriate for the choosen UI).

Well, these are just some random thoughts. I once used Debian's aptitude 
to upgrade a whole system. It was just few key presses and everything 
got downloaded and installed and it even asked configuration questions 
the way I wanted it to. If I once have an LFS system that can be upgraded so 
easily (without leaving stale files and other problems behind), I'm very 
happy.

-- 
Tapio



More information about the alfs-discuss mailing list