Compiler may or may not be running it any given moment. I can run while showing warnings and errors. The compiler is usually a normal console application. You can even create this effect yourself.
IDE is running a compiler as an external process using
System.Diagnostic.Process
, but the standard console output is redirected to two separate streams (
stdout
and
stderr
). IDE implements special stream type; a separate thread(s) in the host (IDE) process reads the line from the streams as they appear and redirect the lines to UI (it can be done via
Dispatcher.Invoke
or
Dispatcher.BeginInvoke
. In this way, the UI can show warnings/error while the compiler is still working, with the UI remaining responsive all the time.
I explained how to do it in detail in my past Answer:
How to read from command prompt[
^].
—SA