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: 103376,fee8802cc3d8334d X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public From: Chris Dollin Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/17 Message-ID: <37697DF2.9EEF1FB@hpjavaux.cup.hp.com>#1/1 X-Deja-AN: 490851629 Content-Transfer-Encoding: 7bit Sender: news@hplb.hpl.hp.com (Usenet News Administrator) References: <7jt2c0$vrb@drn.newsguy.com> <7k57vb$1ipf@drn.newsguy.com> <3766650F.705125B7@pwfl.com> <7k64t7$igo$1@its.hooked.net> <7k689a$ci2@drn.newsguy.com> <3766C842.E1EAB60A@pwfl.com> <3766D1CC.D712895E@itools.symantec.com> <7k7ls5$15tv@drn.newsguy.com> <3767D042.C8A8B131@cajunbro.com> X-Accept-Language: en Followup-To: comp.lang.java.programmer Content-Type: text/plain; charset=us-ascii Organization: Hewlett-Packard Laboratories Mime-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-17T00:00:00+00:00 List-Id: [I've [tried to] set followups to remove comp.lang.ada] "George W. Bayles" wrote: [wrt Java throwing an exception on array-bound violation] > Perhaps because the compiler is allowed to omit the array bounds > checking when it can prove it is safe - which in real programs is > almost always the case. So, the performance penalty is minimized. The Java *compiler* [ie the source-to-bytecode translator] can't do this, because there's no unchecked-array-indexing instructions in the bytecode set. And if it *could*, the verifier would have to be able to prove the same things that *that* compiler did in order to accept the code; which may be infeasible [eg take too long]. A JIT or other bytecode-to-something-faster translator could do it, of course. -- Exceptional Hedgehog