views:

70

answers:

0

Possible Duplicate:
Tool for braceless, whitespace sensitive C syntax

It recently occurred to me, after returning to C after several years of C++ and Python, that the use of curly braces is both ugly and contentious in a language for which I have great admiration. In particular, the use of K&R style leads to "hurried" statements, with an odd trailing } which in my mind ruins the flow of the code. The more C++ style of putting { and } on lines of their own, leads to excessively verbose and fragmented code.

Are there any existing projects, or places to start with respect to writing C in a more modern style similar to Python? I emphasise the use of indentation, and context aware parsing to remove the need for {} around blocks, () around conditions, and a more relaxed syntax regarding variable declaration? Note that I still want to write C, another language is not an option, although similar ideas are of interest.

I expect that hobby projects related to this will begin by implementing a routine to convert "whitespace C" to actual C, before handing over the generated code to the usual compilation process. Any comment regarding potential obstacles and starting places in writing such a converter are of interest (such as maintaining compatibility with the CPP).