Re: Generics are cool



Tim Tyler wrote:
>
> Lee Fesperman <firstsql@xxxxxxxxxxxxx> wrote or quoted:
> > Tim Tyler wrote:
>
> > > IMO, autoboxing sucks.
> > >
> > > AFAICS, it's only good if your point of comparison is the previous version
> > > of Java.
> > >
> > > Take a slightly less myopic perspective - and surely the best thing is
> > > never to have had primitive types in the first place.
> >
> > I'd view that as a myopic perspective. Java wouldn't be appropriate for
> > certain high-performance applications if that were true. [...]
>
> That appears to be the idea that having no primitive types necessarily
> involves a performance hit.

True.

> Performance may have been one of the reasons why primitive types were
> included in Java in the first place - but I think these days the idea
> that having everything be an object involves a performance hit is
> regarded as a fallacy.

Do you have evidence of significant high performance applications written in such a
language?

> Essentially, a JIT should be capable of massaging a program into
> a functionally equivanent form, and whether things are objects
> or not internally becomes largely irrelevant at that stage.

Obviously, I have doubts that it is true in *all* cases. One area I mentioned was heavy
use of dynamic loading.

> Their design decision never got fixed - and now Java appears
> to be stuck forever with primitive types - and it's a factor
> that looks likely to be significantly implicated in Java's demise.

Ultimately, that may be true, but I don't think that is a widely held belief in relation
to a truly general purpose language.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
.



Relevant Pages

  • Re: Generics are cool
    ... >> That appears to be the idea that having no primitive types necessarily ... >> included in Java in the first place - but I think these days the idea ... >> that having everything be an object involves a performance hit is ... > written in such a language? ...
    (comp.lang.java.programmer)
  • Re: newbie lost in strings......
    ... When you do int i = 0; you're declaring a variable i that holds the integer ... holds a reference to an Integer object which holds the integer value 0. ... In some cases, the variable is one of the primitive types (byte, char, int, ... The reason Java includes ...
    (comp.lang.java.help)
  • Re: "Real" Templates for Java?
    ... Java-like language that supports those features, ... avoid the casts nor the boxing/unboxing for primitive types. ...
    (comp.lang.java.programmer)
  • Re: Simple JNI performance question
    ... > How big of a performance hit would my program take if I only used C++ ... > be returning arrays back to my Java program fairly frequently, ... JNI has a relatively high ... Java 2d array is actually an array of arrays, so accessing an item requires an ...
    (comp.lang.java.programmer)
  • Re: Question of JAVA programmer to C# programmers
    ... > all primitive types in Java have the same semantics (aside ... with "fixed" length (as int, char, etc in C or Java), as opposed to ... In Java only variables for the primitive types can be of value types, ... while the rest are reference types. ...
    (microsoft.public.dotnet.languages.csharp)