A chat system (online/offline) runs on a language of your choice like: php, ajax, mysql, c++, etc. In order to code a chat system you will need a coding environment which provides you with all the necessary libraries in order to compile a working and functional chat system (in case you code it in a standalone desktop chat system). From the same environment you can code your chat system using asp, php, css, html or any other language used in online development.
I will recommend you two studios which have all the tools you need: Microsoft Visual Studio and Eclipse IDE which have been created especially for development needs regarding all sorts of applications.