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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7ee10ec601726fbf X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-15 15:05:38 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news2.rdc2.tx.home.com.POSTED!not-for-mail Sender: minyard@wf-rch.cirr.com Newsgroups: comp.lang.ada Subject: Re: is Ada dying? References: <3BC30674.BA88AAB6@brighton.ac.uk> <9pvv3t$ves$1@news.huji.ac.il> <9q42jo$lu8$1@news1.sunrise.ch> <9q95lm$b4l$1@news.huji.ac.il> <3bca9c74.1660187@news.demon.co.uk> <9qedg903km@drn.newsguy.com> <3bcb08bc.29380186@news.demon.co.uk> <9qffea02r59@drn.newsguy.com> Reply-To: minyard@acm.org From: minyard@acm.org Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 Date: Mon, 15 Oct 2001 22:05:37 GMT NNTP-Posting-Host: 24.7.109.109 X-Complaints-To: abuse@home.net X-Trace: news2.rdc2.tx.home.com 1003183537 24.7.109.109 (Mon, 15 Oct 2001 15:05:37 PDT) NNTP-Posting-Date: Mon, 15 Oct 2001 15:05:37 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:14610 Date: 2001-10-15T22:05:37+00:00 List-Id: Robert*@ writes: > In article <3bcb08bc.29380186@news.demon.co.uk>, john.mccabe@emrad.com.nospam > says... > > > >I can understand that and, often, a record can be replaced by a Class > >with no behavioural aspects (i.e. no methods). The problem is that the > >overhead (possibly just in syntax) of a class can be a nuisance and > >confuse the issue and, certainly in Java, there is no way to define > >the representation of elements in a Class (unlike Ada with its very > >powerful representation clauses). To me this shows a great difference > >in the target audience of the languages, and their history. > > > yes. In Java, if you have an empty class it will have a size of 24 bytes. > a class which has nothing but an 'int' in it, is 32 bytes. A class with > nothing in it but one String reference (null) is 50 bytes. So an > object ref byitself uses 26 bytes overhead. This is implementation and processor dependent. I assume you are talking about some specific version of Sun's JVM. I'm also not sure how you measured this, but some measurement techniques can be quite inaccurate (as the first time you allocate something it may allocate other stuff, there is sometimes varying GC overhead, etc.). In GCJ, with the most current version, object overhead is one pointer. That's probably the best you can do. It also happens to lay this out exactly like a C++ class, and method calls between C++ and Java (both directions) can be done directly. > This also ofcourse means that Java use for same sort of applications where > ada representation clause is needed will be not practical to say the > least, but I do not see Java being used for those types of applications > (java programmers will look funny at you if you start talking about > representation of records and stuff like this). The design goals of Java were diametrically opposed to any type of representation clause, since it was designed for extreme portability and for security. Saying Java wasn't designed is a little over the top. It wasn't formally designed in an open process, but the designers definately had design goals, wrote them down, and debated them. You may not like their process or goals, but it was designed. For instance, they had a definate reason (that was debated by the designers) for not including an enumeration type - lack of extensibility in subclasses. -Corey