Configurable syntax

Georg Wrede georg.wrede at iki.fi
Fri May 22 06:20:28 PDT 2009


Jason House wrote:
> Georg Wrede Wrote:
> 
>> --- Disclaimer: this is a bit long. Read it later. ---
> 

> Wow, you're right. Sadly, I stopped reading about 80% through
> (discussion on D4)

Yeah, one should not write opinion pieces when inspired...

> At a high level, I agree with your assessment about an easy growth
> path for newbors to gurus. I should also add that a language must
> make the code of gurus remain understandable for all but the newest
> of newbies. (Ever try to read through STL or a boost library?)

(Yeah, reading that kind of code makes one feel inferior to the gurus. 
And so very sad that the language makes even mid-level stuff entirely 
uncomprehensible. Not to speak of the amounts of time it has to take 
coding it.)

Strictly speaking, there's no way for a language to make guru code 
understandable to "anti-gurus". However (and what I guess you were 
thinkng of), when somebody uses the most advanced features in a 
language, then his stuff should not become incomprehensible to 
"anti-gurus" just because of the language itself.

What I mean is, if somebody does tensor algebra, it's pretty sure a high 
schooler won't get it, no matter what the language is. *But*, if someone 
calculates the area of a rectangle or a triangle, using the most 
advanced language features, then the *language* should not make it 
incomprehensible to non-gurus, or even "anti-gurus".

(I have to admit, no language can guarantee this, but it definitely has 
to be the aim when designing advanced language features.)

> I also had an idea for a configurable syntax language that I almost
> started developing.
...
> My inspiration was seeing various boost libraries such as spirit and
> lambda. They seemed like the coolest things ever, but all they did
> was add new syntax for a common coding need.  I hadn't heard of LINQ
> but knew such a thing was feasible in my language...

Spirit and lambda have inspired lots of people. Me too. And LINQ is a 
cool thing too. When I originally wrote about configurable syntax, LINQ 
would have made an excellent example of its usefulness. Sadly, I didn't 
know about it at the time.



More information about the Digitalmars-d mailing list