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: fac41,3ef3e78eacf6f938 X-Google-NewGroupId: yes X-Google-Thread: 103376,3ef3e78eacf6f938 X-Google-NewGroupId: yes X-Google-Thread: 1008e3,3ef3e78eacf6f938 X-Google-NewGroupId: yes X-Google-Thread: 108717,3ef3e78eacf6f938 X-Google-NewGroupId: yes X-Google-Attributes: gide91fe56a56,gida07f3367d7,gid8d81cdf253,gid5b1e799cdb,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!s20g2000prm.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Tue, 23 Mar 2010 12:33:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4BA8BA91.4050905@cherrystonesoftware.com> <4BA8F677.3090206@adalog.fr> <4BA8FD54.8020200@cherrystonesoftware.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1269372828 17123 127.0.0.1 (23 Mar 2010 19:33:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 23 Mar 2010 19:33:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s20g2000prm.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.eiffel:524 comp.lang.ada:9708 comp.lang.modula3:144 comp.programming:14644 Date: 2010-03-23T12:33:46-07:00 List-Id: On Mar 23, 10:41=A0am, Jim Balson wrote: > J-P. Rosen wrote: > > balson a =E9crit : > >> =A0 =A0 =A0IOW, stay away from the likes of Java, C#, Pascal. Unless y= ou have a > >> very specific reason for going in that direction. Your performance wil= l > >> suffer. > > > I don't see why you put Pascal in the same basket. Pascal is not part o= f > > the benchmark, therefore there is no evidence for what you say, and > > Pascal does not require an interpreter or semi-interpreter. > > I included Pascal because once you get up into languages that do bounds > checking, performance will degrade. Pascal is one of those languages > that does bounds checking. It comes down to this: > > a) Either the programmer writes code to not exceed array bounds, or > b) Use a language that does it for you. > > The choice of (a) will cost you a little bit of time developing. > The choice of (b) is going to cost you in performance when done. Aside from the fact that (as Pascal Obry pointed out) compilers for languages that do these checks for you usually provide a way to suppress those checks, (a) is a little bit na=EFve. Or maybe a lot na=EFve---I don't know. But it's like saying (c) The programmer writes code that just works perfectly all the time. I wish I could! I've been in this business for over 30 years and I still haven't figured out how not to make mistakes. I suspect that it may have to do with my being a member of _Homo sapiens_. But I'm sure that the folks at Microsoft, Oracle, etc., try to write code that "doesn't exceed array bounds" (and doesn't do double deallocation, etc.). But all they have to do is make a mistake in one case, and the result is software with a vulnerability that bad guys figure out how to exploit, and now the amount of performance time you save by not doing bound checks is dwarfed by the amount of total time thousands of people spend trying to clean malware off their computers, restore destroyed data from backup, etc. So bounds checking is a good thing. Even so, it's good to have a choice. Pascal and Ada, as usually implemented, let you choose between the extra safety of bounds checks and the added performance of eliminating them in programs that have been tested. C doesn't. -- Adam