From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!wns14feed!worldnet.att.net!63.218.45.10!nx01.iad01.newshosting.com!newshosting.com!198.186.194.250.MISMATCH!transit3.readnews.com!news-out.readnews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder2.news.saunalahti.fi!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Wed, 24 Jan 2007 19:03:10 +0200 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How come Ada isn't more popular? References: <1169531612.200010.153120@38g2000cwa.googlegroups.com> <1169588206.234714.312650@k78g2000cwa.googlegroups.com> <1169624573.534128.172610@s48g2000cws.googlegroups.com> <87sle0sv9o.fsf@ludovic-brenta.org> <1169655934.028861.51000@j27g2000cwj.googlegroups.com> In-Reply-To: <1169655934.028861.51000@j27g2000cwj.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <45b78ff6$0$22511$39db0f71@news.song.fi> Organization: TDC Song Internet Services NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1169657846 news.song.fi 22511 81.17.205.61:32937 X-Complaints-To: abuse@song.fi Xref: g2news2.google.com comp.lang.ada:8495 Date: 2007-01-24T19:03:10+02:00 List-Id: Without wishing anyone ill, I want to sound my whistle to point out some fouls in this battle... Adam Beneschan wrote: > > On Jan 24, 12:07 am, Ludovic Brenta wrote: > >>kevin cline writes: >> >>>But the point was that expressiveness drives programmers to new >>>languages, and Ada isn't particularly expressive.On the contrary, I think that Ada is the most expressive language >> >>around. Consider: >> >>procedure Set_Bit_In_Register (At_Address : in System.Address) is >> type Register is array (1 .. 32) of Boolean; >> pragma Pack (Register); >> for Register'Bit_Order use System.High_Order_First; According to RM 13.5.3, the Bit_Order attribute can be specified only for record types, not array types like Register, so this Bit_Order clause is nonstandard. But this is perhaps not central to the argument... >> pragma Volatile (Register); >> >> R : Register; >> for R'Address use At_Address; >>begin >> Register (4) := True; >>end; If the High_Order_First clause were allowed for type Record, this would set the 4th highest bit, that is the bit for 2**28. If the bit indices run the other way, this would set the 4th lowest bit, the bit for 2**8. >>versus >> >>void set_bit_in_register (volatile unsigned long * at_address) >>{ >> *at_address |= 2 << 3; >> >>} That sets the bit for the 5th lowest bit, the bit for 2**16. Note that the shifted thing is 2#10#, not 2#1#. > I think maybe I understand how C might be considered "more expressive" > to some programmers. If you want to set the third bit of this word, > you can just type in what you want, without going through a whole lot > of rigmarole like defining types and telling the compiler what you > intend to do and what order you think the bits are in and stuff like > that. You can just say it. Of course, if there's a misunderstanding > between you and the compiler... There is a misunderstanding somewhere, because the oh-so-expressive C code is not doing the same thing as the Ada code (in either Bit_Order), nor the same thing as you say it does. And of course the same formula can be written in Ada with modular types, Shift_Right, "or". More characters to type, but less line-noise style and no need to check the well-thumbed page of my C manual that shows the C operator precedence table. This page has had a yellow post-it tab on it for a long time... :-) -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .