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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,c7b637f8b783b7c X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,c7b637f8b783b7c X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,c7b637f8b783b7c X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,c7b637f8b783b7c X-Google-Attributes: gidf43e6,public X-Google-Thread: 107d55,c7b637f8b783b7c X-Google-Attributes: gid107d55,public X-Google-Thread: 1108a1,c7b637f8b783b7c X-Google-Attributes: gid1108a1,public From: Laurent Guerby Subject: Re: The great Java showcase (re: 2nd historic mistake) Date: 1997/08/29 Message-ID: #1/1 X-Deja-AN: 268890153 Sender: guerby@boole.enst-bretagne.fr References: <34023FC9.59E2B600@eiffel.com> <3404670B.C3A2C4A2@pagesmiths.com> <01bcb38a$8ddc1200$1c10d30a@ntwneil> Organization: ENST de Bretagne, Brest FRANCE Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel,comp.lang.java.tech,comp.lang.c++ Date: 1997-08-29T00:00:00+00:00 List-Id: doylep@ecf.toronto.edu (Patrick Doyle) writes: > > [...] > That's a pretty cheap shot, Robert. Plus, it's not necessarily > true. There are applications that just beg for automatic memory > management, and if they happend upon one of these, they certainly > could have seen such an improvement. > > For my part, I'd guess that at least 40 to 50% of my time is > spent looking for memory allocation bugs in C++. > [...] Ada has the ability to manipulate unconstrained objects (something like returning dynamic sized objects/arrays) without requiring user heap management. The greatly obviates the need for user allocation/deallocation, you can write very large Ada programs without doing fine grained heap management (and I agree with you, very error prone unless you're some kind of programming deity ;-). When doing graph/tree stuff, you'll often see a big dynamically allocated array behind the scene in Ada programs, reallocated when there's not enough room, a good example of this is GNAT (see the generic unit table in the sources). It is an area where language matters, by allowing stack (the Ada compiler may use dymaic allocation behind your back, but I guess most modern Ada technologies use a secondary stack) allocated complex dynamic types (Ada case) or by providing garbage collection (Java). I've seen high level translation to Ada of C++ API, which originately required the user to worry a lot about heap management (conventions C1, C2, ... C6, that kind of stuff), giving an Ada version without any heap management (discrimated types and unconstrained arrays doing the job). Needless to say, bye bye the "40% to 50% of the time" chasing heap problems ;-). -- Laurent Guerby , Team Ada. "Use the Source, Luke. The Source will be with you, always (GPL)."