Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26650

Re: Alternatives languages on the JVM: which one or is there no alternative?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Alternatives languages on the JVM: which one or is there no alternative?
Date Wed, 27 Nov 2013 23:07:50 -0600
Organization A noiseless patient Spider
Lines 35
Message-ID <l76j3e$27f$1@dont-email.me> (permalink)
References <b61c37c4-1b86-4b63-8ed1-fa5834eb638e@googlegroups.com> <l733pd$7kk$1@Gaia.teknon.de> <bfklnaFis1vU1@mid.individual.net> <l73v2h$f22$1@Gaia.teknon.de>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 28 Nov 2013 05:07:58 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="c6716b6a473a9c60ebbf78e095cba276"; logging-data="2287"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/A7WaYjcNogXTMAgXhJ9DEE1vivtwEnEU="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Thunderbird/26.0
In-Reply-To <l73v2h$f22$1@Gaia.teknon.de>
Cancel-Lock sha1:q0N4JStosuYgOFJf2Ksv44NiQzM=
Xref csiph.com comp.lang.java.programmer:26650

Show key headers only | View raw


On 11/26/2013 11:13 PM, Volker Borchert wrote:
> You still have an extra two-word object header, and you cannot use
> WeakReference<T> directly if you want the Foo to act on the
> reference being cleared by garbage collection. These 24 extra bytes
> hurt if you are doing low-level stuff and expect some tens or
> hundreds of thousands of Foo.

And you think multiple inheritance has no costs? The moment you allow 
multiple inheritance of implementations, you permit the so-called 
"diamond problem." The diamond problem has three solutions:
1. There are multiple copies of some fields.
2. Offsets to a particular named field are dependent on object 
instances, not on classes/class hierarchies.
3. Casting up or down a tree requires recomputing offsets on a 
per-object instance basis, not a per-class basis.

The first case only affects classes that are involved in the diamond 
problem, but the effects are so egregiously awful (in the case where 
data is actually present) that it is prudent to outlaw it from 
happening. The latter two cases impose a performance penalty on the 
entire program, even if the diamond problem never arises: you're paying 
for what you don't use.

Multiple inheritance is a seductive call. There are very, very, very few 
times where it is actually proper--recall that inheritance, at least as 
Java is concerned, is meant to model an "is-a" relationship, not a 
"has-a" relationship. Since inheritance is an indelible part of the 
public contract of a class in Java, the "is implemented in terms of" 
relationship is supposed to be handled via composition (cf., Effective 
Java). Let the JIT and the optimizer work through the overhead; 
premature optimization, after all, is the root of all evil.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-11-25 03:09 -0800
  Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-25 12:46 +0100
    Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-11-25 05:20 -0800
    Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-11-25 22:10 +0100
      Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-11-25 14:34 -0800
      Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-26 08:54 +0100
        Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-11-26 00:29 -0800
          Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-26 15:29 +0100
            Re: Alternatives languages on the JVM: which one or is there no alternative? Arne Vajhøj <arne@vajhoej.dk> - 2013-11-26 21:55 -0500
              Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-27 08:59 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Joerg Meier <joergmmeier@arcor.de> - 2013-11-27 10:41 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-28 12:48 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? leif.roar@invalid.com (Leif Roar Moldskred) - 2013-11-28 16:28 -0600
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-29 00:03 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-11-29 00:41 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-29 12:05 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-11-29 03:51 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-29 16:44 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-11-29 16:48 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-12-02 06:33 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-12-02 15:50 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-12-02 16:26 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-12-02 21:07 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-12-02 23:33 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? markspace <markspace@nospam.nospam> - 2013-12-02 18:07 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-12-03 08:59 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-12-03 00:14 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Silvio <silvio@internet.com> - 2013-12-03 09:42 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-12-03 02:58 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Martin Gregorie <martin@address-in-sig.invalid> - 2013-12-03 20:55 +0000
                Re: Alternatives languages on the JVM: which one or is there no alternative? Saxo <jeti789@web.de> - 2013-12-04 00:12 -0800
                Re: Alternatives languages on the JVM: which one or is there no alternative? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-14 03:31 -0400
                Re: Alternatives languages on the JVM: which one or is there no alternative? Martin Gregorie <martin@address-in-sig.invalid> - 2013-12-14 10:11 +0000
                Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-12-14 17:39 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-12-14 16:52 +0000
                Re: Alternatives languages on the JVM: which one or is there no alternative? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-14 13:47 -0400
                Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-12-14 23:55 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Sebastian <news@seyweiler.dyndns.org> - 2013-12-04 10:39 +0100
                Re: Alternatives languages on the JVM: which one or is there no alternative? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-12-14 03:56 -0400
  Re: Alternatives languages on the JVM: which one or is there no alternative? v_borchert@despammed.com (Volker Borchert) - 2013-11-26 21:28 +0000
    Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-11-26 23:29 +0100
      Re: Alternatives languages on the JVM: which one or is there no alternative? v_borchert@despammed.com (Volker Borchert) - 2013-11-27 05:13 +0000
        Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-11-27 22:57 +0100
          Re: Alternatives languages on the JVM: which one or is there no alternative? v_borchert@despammed.com (Volker Borchert) - 2013-11-29 23:22 +0000
            Re: Alternatives languages on the JVM: which one or is there no alternative? Robert Klemme <shortcutter@googlemail.com> - 2013-11-30 14:41 +0100
            Re: Alternatives languages on the JVM: which one or is there no alternative? Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-11-30 16:49 -0600
        Re: Alternatives languages on the JVM: which one or is there no alternative? Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-11-27 23:07 -0600
          Re: Alternatives languages on the JVM: which one or is there no alternative? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-11-28 23:41 +0000
            Re: Alternatives languages on the JVM: which one or is there no alternative? Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-11-29 00:08 -0600
              Re: Alternatives languages on the JVM: which one or is there no alternative? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-11-29 16:49 +0000
                Re: Alternatives languages on the JVM: which one or is there no alternative? Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-11-30 16:46 -0600
                Re: Alternatives languages on the JVM: which one or is there no alternative? Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2014-02-14 15:36 +0000
          Re: Alternatives languages on the JVM: which one or is there no alternative? v_borchert@despammed.com (Volker Borchert) - 2013-11-29 23:37 +0000
  Re: Alternatives languages on the JVM: which one or is there no alternative? Roedy Green <see_website@mindprod.com.invalid> - 2013-11-28 12:50 -0800

csiph-web