My answer is very generic as you didn't tell anything about your application.
Should the GUI be separated from the application's logic?
In the code, definitely. Running in a separate process, possibly on a separate machine, might also be a good idea, but this really depends on your requirements.
Reasons to fully separate it:
- Running application as a daemon or system service (in the background) while the GUI is not running
- Controlling the application remotely over a network
- Possibility of multiple independent GUI implementations, using different programming languages (e.g. iPhone?)
- Support for automated control (scripting) without GUI
- Implementing the separation later, if not initially done, is almost impossible
Reasons why not to separate:
- Serialization of all I/O is required, making the implementation harder
- Slight performance degration if very large amounts of data are transferred (this really does not affect your typical GUI application in any way)
If it is separated, how should the logic and the GUI communicate? Are TCP/IP sockets a good option? What are other possibilities?
HTTP is a popular choice and it avoids most problems with firewalls and such. In C/C++ you can use libcurl for http/https requests and Boost.CGI (not yet accepted to Boost) or one of the other CGI libraries for the server side.
Other options for IPC include shared memory (Boost.Interprocess), UNIX sockets and other network protocols. However, I would not recommend these unless very large amounts of data are transferred.
Is it a good idea to have the GUI in a language different than a C++? If yes - which language?
I don't see much benefit from this. Still, separating the GUI allows writing it - possibly even multiple implementations of it - in different languages.
Is it a good idea to have a browser-based GUI?
Definitely. If what you need can be done with HTML5 and JavaScript, do not even consider a traditional GUI, just make it a webapp instead.
The benefits are:
- Fully cross-platform
- No installation of software on users' machines
- All the clients always use the latest version of the GUI
- Web GUI frameworks are actually nicer to work with than traditional GUI frameworks are
- No need to separate the GUI into a separate process
- Still possible to use from scripts (e.g. using the
curl
program from a shell script)
On the other side, you will get slight performance degradation, but once again it doesn't affect a typical GUI application enough to matter.
Even though the project's core logic is cross-platform, I can decide that the GUI will be only Windows-based (.NET?) and it will communicate with the logic on the relevant Win/Linux machine through Socket or similar method. Is it a good idea to do so?
The APIs of cross-platform GUI libraries are somewhat horrible. Qt does pretty good job at looking native nowadays and its API is rather good, even though it has a major impact on your application. Try to restrict any usage of Qt strictly to the GUI. The other option for true native cross-platform GUI is wxWidgets, which integrates better with other C++ code, but has a very nasty and error-prone API.
For web UI, you should definitely consider Wt, which is a high-level C++ AJAX framework, with an interface similar to Qt, but using modern C++ practices instead of taking over your application like Qt does.