C tips (again)

Georg Wrede georg.wrede at iki.fi
Sat May 2 03:04:47 PDT 2009


bearophile wrote:
> From a certain point of view you can think of a medium/high level as
> D/Python/Ruby/Java as a collection of idioms of low level languages,
> that now you can use at high level (OOP can be seen as a collection of
> idioms in C. In old structured programming can be seen as an idiom. In
> the beginning even routines and functions were seen as idioms in
> assembly programming.

The same has happened in hardware. Now we have even systems-on-a-chip. 
All you need is solder the connectors on (for say USB, keyboard, etc.), 
and you have an entire computer.

> There was even people that have discussed about
> the pro/cons of using routines!).

Yeah, always naysayers. OTOH it's good, since then the merits of the new 
thinking get studied better.

> That said, to design a good medium/high language (I consider D a
> medium level one) you must choose the right idioms, the best ones.

I think D is aiming to be a /both/ low, medium, and high level language. 
And I think that's the right thing to do. Then you can use almost the 
same syntax all the time, while still being able to use the particular 
level that the current source line of your code needs.

I'd call that luxury, simply because I believe D is almost unique here.

Had I a medium level language, then I'd have to resort to a high and a 
low level language to do some of my application. That is a serious PITA, 
like I guess everyone agrees.

> Those ctips are a collection of good low-level idioms. I think may be
> a good starting point to design a medium-level language (with power
> similar to C). So they can be useful to design part of D too. Currently
> D has already added some of those idioms.



More information about the Digitalmars-d mailing list