axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] Axiom BNF


From: Bill Page
Subject: RE: [Axiom-developer] Axiom BNF
Date: Mon, 25 Oct 2004 13:18:02 -0400

On Monday, October 25, 2004 9:52 AM Ralf HEMMECKE wrote:
> 
> I simply don't like it. When I once programmed in Axiom I was
> always confused about how much I have to indent a line so that
> the scope is right.

As a matter of style and personal preference, I understand your
view but I don't sympathize. Because of my programming background,
my initial reaction was similar to yours but reading Axiom algebra
code and programming in Python has changed my mind.

> I was so happy to learn that Aldor's native mode is more
> C-like.

As far as I can tell, Aldor supports both modes interchangeably.
If you include braces and semicolons in your code, then it
expects you to continue to do so. But if you omit them and use
standard indentation it is just as happy.

> Unfortunately, I cannot reproduce some of the problems that
> made me wish to have some more syntax than just indentation
> to specify the scope.
> 
> And I never felt that adding braces and semicolons is so much
> pain.

It is not so much that it is a "pain" to add such decorations
but rather that it tends to obscure the structure of the program
and permits a layout style that is too flexible. I think properly
and consistently indented code (as required by SPAD) is easier
to read than most C-like coding styles.

> 
> And maybe some day the Aldor compiler might not support
> #pile mode anymore.
>

That seems to be a choice over which we might have some
influence.
 
> By the way, are there already any results about distributing
> the Aldor compiler with Axiom?
>

As far as I know, none. :(
 
> And may I ask back why you are (or why you are not) in favour 
> of SPAD's #pile mode? One can have a nice indentation also
> with the braces and semicolons.

Using indentation that is syntactically checked by the compiler,
results in a minimal, natural and more expressive 2-d layout
instead of a 1-d serialization that might be (slightly) more
convenient to the compiler. Yes of course I agree that indentation
as a form of "commenting" is not inconsistent with this 1-d
serialization, but in programming language design I am inclined
to favour the dogmatic, rather than permissiveness, for the sake
of consistency and precision.

Since we use 2-d computer displays and all of the editors in
common use respect such 2-d formatting, why not use it in an
essential way in the programming language? Extra braces,
parenthesis, begin-end, do-od, if-fi, and ; at the end of a
statement, etc. now just seems ugly and unnecessary to me. 

Cheers,
Bill Page.

> 
> Bill Page wrote:
> > On Monday, October 25, 2004 8:44 AM Ralf HEMMECKE wrote:
> > 
> >>...
> >>Nevertheless, I would not suggest the #pile mode.
> >>
> > 
> > Why?
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]