[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: New language syntax

Hi All,

Jim wrote:
> I was at one time very keen on introducing a more C-like 
> syntax to occam or
> it's successor, but I've changed my mind a bit.  I think that using
> indentation as a delimiter is a good
> thing.  It only really upsets people when they don't 
> understand when they
> should indent and outdent (I remember being in a large group 
> of students
> bitching about occam's indentation).  Experience will teach 
> those people how
> to indent properly anyway, so it will simply speed their 
> learning :).  Most
> of us probably indent code the same way as occam anyway (i.e. 
> we indent at
> the start of a block and outdent at the end).  How many 
> spaces are used,
> where the braces go and whether tabs are used seems to be 
> very personal.
> Editing other peoples code can be horrible.

There is a difficult for the reader in clearly determining the scope of a
statement whether it is the use of curly brackets in C or indents in occam.
There is on easy way to verify the beginning and ending of a statement
particularly if the scope of the statement is more then a page of code.  In
VDHL there is some support for this, you can use optional labels to help,
see example below.

	PROCESS( .....)
         blah blah;

      END PROCESS Proc1;

This helps the reader but my understanding of VHDL compilers is that the
labels are ignored.  Why can't compilers provide more support for this type
of syntax?

When comparing the use of indents to curly brackets, one disadvantage of the
use of indents is that it is harder to modify with a standard text editor.
When for example an IF statement is added to the code it can result in
altering the indent of many lines of code.

Re: Folding editor
I was very happy to use a folding editor but most of my research students
were very reluctant to do so.  Compared to the Borland C and the EMAC C the
folding editors that I have tried do not support highlighting of keywords.
Most people consider highlighting to be more important then folding.
Another problem with many compilers is the integration of the editor as part
of the development tool.  As TDS unbundled its tools many other developers
integrated the functions.  

What I would like is a combination of highlighting and folding and the
option to choose my favourite editor with the development tool. 

Happy Christmas,


Prof. Brian C. O'Neill        | Tel: +44 0115 848 6044
Dept of Elec & Electronic Eng | Fax: +44 0115 848 6567
Nottingham Trent University   | E-mail: Brian.ONeill@xxxxxxxxx
Nottingham                    | http://eee.ntu.ac.uk/research/parallel
NG1 4BU                       |