Syntax question...

RA ra at wolven.net
Tue Oct 31 14:26:44 PST 2006


== Quote from Jarrett Billingsley
> What kind of syntax are you thinking?  (I'm genuinely interested :) )

> In any case, it would be nice to have some kind of D grammar to start from,
> so you'd know what all the various language constructs your new syntax would
> have to support, rather than picking out all the grammar bits from the D
> spec.  There _is_ one somewhere, but (1) I don't know if it's kept entirely
> up to date and (2) don't know what it's called or where it is.  :|

== Quote from Jarrett Billingsley

The kind of syntax I'm thinking of would be one that would be easily readable and
understood by virtually any programmer. It would be more verbose than
C\C++\D\etc..  and cleaner and more  logical than VB.  Simple, readable, logical
and consistent would be the primary goals.  I would try to use generally
understood words and symbols except where they just don't make sense unless you've
been "educated" as to their meanings within a particular language.  Obviously,
that's not a completely achievable goal, but a worthwhile target in my opinion
nonetheless.

Here are a few examples.  I think ==, &&, ||, etc. suck.  = means equal, not ==.
I would change the & and | symbols to something new.  I would change the * to the
"normal" multiplacation symbol (little x floating midline), the / to the normal
divide symbol, the ! to the normal not equal (equal with a diagonal slash thru it,
and I would use the ascii decimal 171 and 187 ((hex 00AB and 00BB) they look like
small << and >>) as the "literal" identifiers instead of quotation marks... and so
forth and so on.

Things like "If a !<= b" just don't make any sense to me.  I think it's much
clearer and correct as "If a > b".  Anyone that would use !<= is just being
perverse IMO... :)

I would use; Do, DoWhile, DoUntil, EndDo, EndDoWhile, EndDoUntil, If, EndIf,
BegFunction, EndFunction, BegProp, EndProp, etc...

I liked and applauded your "no need for '->'" comment in your VB example.

I've been an application programmer for over 20 years.  For the first 10 years I
worked on the IBM S\36 and AS\400 using RPG.  The next 10 years was programming
Windows using Visual RPG (kind of a cross between freeform RPG and VB).

One thing I've noticed over the years is that with each new generation of
programming languages and operating systems, I keep getting moved closer and
closer to system level programming.  As a supposedly "high level" programmer,
personally, I find that annoying.  The fact that I "can" write my own string
object is entertaining (if I felt like it), but the fact that I HAVE to absolutely
sucks.

Nice features that were built into the OS and language\compiler I used 15 years
ago have dissappeared and now I have to do them MANUALLY.  That sux.  Memory
management? Garbage collection?  Ten years ago, I had no idea what that meant.  I
didn't NEED to because the OS and compiler took care of it for me...
AUTOMATICALLY!  God, what a novel concept.

A few things I've noticed mentioned on the forums here... integer, double, float,
unsigned integer, decimal, and on and on.  WTH is that about?  All I want is a
NUMBER with nine digits and two decimals...  you can store it in memory ANY DAMN
WAY you like, but I don't NEED to know or care about it.  And I damn sure don't
want to have to manually convert "cast" it to make my math work.

I think Walter mentioned that no one has a nice data file handling system.  Other
than the AS\400 and ASNA's duplication of that file system on Windows, I've never
seen anything "nice".  MSSQL, MySQL, etc... are a royal pain in the hiney,
anything but nice.  I've come to the conclusion that the only reason those things
are used is because MOST programmers have never worked on a "nice" system with a
"nice" OS, language and database.

Anyway...  enough ranting.  :)

I really like what I've read on here about Walters tossing of "legacy"
compatibility and ignorant "features" of C++ when designing D.  And trying to make
it more modern with garbage collection, eliminating pointers (although it sure
seems to have a lot of support for them), etc..

I just personally don't care for the syntax. But given my background, I think
that's understandable.  I think it would be great to give D a second syntax that
would be "easier" to learn\understand for people that aren't coming from a C
background.  Much the same way MS has C# and VB.

What do you think?





More information about the Digitalmars-d mailing list