I had a thought. What does anyone think?
It would be great to have an IDE which could compile your C program *as you type*.
Think about it, the compilation process for a single file typically takes a matter of seconds, yet I spend minutes or hours typing and thinking between compilations. This time could be used to compile the code.
Reasons why this would be a good thing:
* Compilation would already be done by the time you want to compile. Just linking to do.
* The IDE could give you much more information as you type. For example
- type checking information
- syntax checking
- 'Lint' type comments
- How many instruction cycles does each line take to perform.
- How effective is the optimisation?
All of these things would be so useful, especially the instruction cycle count. Sometimes it can be surprisingly very high. It would be better to know this at typing time, than having to go digging for it after compiling.
The screen could be split into several columns. You type code in the left one. The next one shows the first pass of the compiler, producing internal symbolic information. Then the optimisation pass, then the output instructions. (or something like that)
Is it possible? One of the reasons I have heard that this wouldn't work is that the code would be full of syntax errors as you type, so would not compile. However, I don't think this is a problem. The syntax colouring IDEs don't crash when they see a syntax error, they just do their best until it's fixed. The same could be true of the compiler. It would wait until the errors were gone, then compile that line / function / section.
What does anyone else think about this idea?