Is it possible to write a program using Bonjour or a Bonjour-compatible library in a cross-platform language such as Java or Python? If so, where can I find the files needed for this?
For Java have a look at the jmdns library which does it all in pure Java. http://jmdns.sourceforge.net/
I do not believe it can delegate to the native implementation if running on OS X, but it has been a while, so it might these days.