Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > no more primitive data types in Java (JDK 10+). What do you think?

Reply
Thread Tools

no more primitive data types in Java (JDK 10+). What do you think?

 
 
Silvio Bierman
Guest
Posts: n/a
 
      04-20-2012
On 04/20/2012 01:27 AM, Nasser M. Abbasi wrote:
> According to
>
> "To Java SE 8, and Beyond! Simon Ritter Technology Evangelist, Oracle"
>
> (Google the string "To Java SE 8 and Beyond!" and click on
> the PDF file, about the 5th link down the page)
>
> On page 42, it says:
>
> "Unified type system (JDK 10+)
> No more primitives, make everything objects"
>
> I've seen very little discussion on this very important
> subject.
>
> What do the experts here think of the idea?
>
> For me, and I am no expert, I think it will be good to have
> a consistent type model (everything is an object), but I am
> worried that the performance will take a hit (computational finite
> elements methods, large meshes, etc...), unless PC's and computers
> will become 1000 times faster by the time JDK 10+ comes in few years
> from now, which might be possible.
>
> Any one knows more information about this item?
> Any truth to it? Do you think it will really happen?
>
> --Nasser


Scala already works this way. There is a common super type Any with
subclasses AnyRef (akin Object) and AnyVal. The "primitives" reside
under AnyVal.
 
Reply With Quote
 
 
 
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      04-20-2012
Robert Klemme <(E-Mail Removed)> wrote:
> On 04/20/2012 02:31 AM, Lew wrote:


(snip)
> As an additional data point: Ruby MRI works like that. Basically
> integers (instances of class Fixnum) look like ordinary objects but
> under the hood the value is encoded in the reference and there is no
> object on the heap. You get a nice consistent model for the language
> user but avoid the overhead of GC.


I have used arrays dimensioned [1] in Java where I needed a
primitive type as an object. I believed at the time that it was
faster than the other ways to do it.

-- glen
 
Reply With Quote
 
 
 
 
Gene Wirchenko
Guest
Posts: n/a
 
      04-20-2012
On Thu, 19 Apr 2012 23:15:35 -0700, Peter Duniho
<(E-Mail Removed)> wrote:

>On Thu, 19 Apr 2012 19:22:33 -0700 (PDT), Lew wrote:
>
>> Arved Sandstrom wrote:
>>> This is the teens of the 21st century after all.

>>
>> Quibble: Not until next year.

>
>Yeah, but you have to take into account the kind of people who insisted
>that the new millennium started on Jan 1, 2000. The concept of "teens"
>may be more, um...flexible to some people than to others.


An amusing thing just occurred to me.

We are the sort of people that insist on getting things right,
things like the new millennium and new century starting 2001-01-01
(and "millennium" being spelled with two N's, but that is another
battle). To us, neither time period started until a year later than
the 2000ers think.

And yet, and yet, we often start counting at zero which is one
earlier than most do!

>(For the record, I'm with you, but I hardly ever try to explain this sort
>of mistake to people who make them any more )


It is worth it to weed out people w.r.t. use of logic. Explain
it once. If the person gets it, fine. If not and especially if the
person argues with you on it, *WEED OUT*.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      04-20-2012
On 04/19/2012 11:15 PM, Peter Duniho wrote:
> On Thu, 19 Apr 2012 19:22:33 -0700 (PDT), Lew wrote:
>
>> Arved Sandstrom wrote:
>>> This is the teens of the 21st century after all.

>>
>> Quibble: Not until next year.

>
> Yeah, but you have to take into account the kind of people who insisted
> that the new millennium started on Jan 1, 2000. The concept of "teens"
> may be more, um...flexible to some people than to others.


But it did, by popular acclaim. There is no "real" millennium other than the
day after whenever it was hardest to get New Year's Eve hotel reservations at
Times Square. Prince didn't write "party like it's 2000" or entitle his album
"2000". There weren't mass panics at the end of 1000, but at the end of 999.

I thumb my nose at those who pedantically insist that the millennium must
begin in 2001 because there was no "year zero" and remind them that there was
no "year one" either until about what, three or four centuries later, and no
agreement on that for millennia after.

Nor did those early years begin on Jan. 1. So really the pedants should claim
April 2, 2001, as Millennium Day, accounting for the Gregorian calendar shift.

And if thirteen years starts the "teens", then they start April 2, 2014.

Half-assed pedants; don't even follow through.

I'm'a go where the party at while y'all argue over when the millennium begins.

> (For the record, I'm with you, but I hardly ever try to explain this sort
> of mistake to people who make them any more )


I enjoy it.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      04-20-2012
BGB wrote:
> I think for many, "teens" starts at 10 (rather than 13), so 2010-2019 would be
> the "teens" of the new millennium.


If many thought the world were flat, would that make them right?

No.

"Ten". "Eleven". "Twelve". "Thir_*teen*_". "Four_*teen*_". "Fif_*teen*_". ...

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      04-20-2012
Gene Wirchenko <(E-Mail Removed)> wrote:
> On Thu, 19 Apr 2012 23:15:35 -0700, Peter Duniho
> <(E-Mail Removed)> wrote:


(snip)
>>Yeah, but you have to take into account the kind of people who insisted
>>that the new millennium started on Jan 1, 2000. The concept
>> of "teens" may be more, um...flexible to some people than to others.


(snip)
> We are the sort of people that insist on getting things right,
> things like the new millennium and new century starting 2001-01-01
> (and "millennium" being spelled with two N's, but that is another
> battle). To us, neither time period started until a year later than
> the 2000ers think.


> And yet, and yet, we often start counting at zero which is one
> earlier than most do!


While we are in the third millenium and the 21st century, I never
hear anyone say that we are in the 202nd decade. I don't ever
remember anyone saying we were in the 199th, 200th, or 201st
decade, either.

It seems to me that decades don't count the same way as centuries.

In addition, with a few year uncertainty in the actual date
that christ was born, worrying about the difference in millennia
seems a little strange.

-- glen
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      04-20-2012
On 20.04.2012 17:05, glen herrmannsfeldt wrote:
> I have used arrays dimensioned [1] in Java where I needed a
> primitive type as an object.


That was often the approach if one wanted to modify a value in the
caller's or other scope. I'd rather have a mutable integer object.

> I believed at the time that it was
> faster than the other ways to do it.


And, was it?

Cheers

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 
Reply With Quote
 
Bernd Nawothnig
Guest
Posts: n/a
 
      04-20-2012
On 2012-04-20, Roedy Green wrote:
> On Thu, 19 Apr 2012 18:27:43 -0500, "Nasser M. Abbasi" <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>
>> "Unified type system (JDK 10+)
>> No more primitives, make everything objects"

>
> This is the way Eiffel works,


The same for Python.

> but under the covers there are still primitives. Perhaps what they
> have in mind for Java, more intelligent boxing. At least at the low
> levels of the JVM you need primitives.


These implementation details should better be hidden and invisible for
most cases. Let the compiler automatically detect and generate
possible optimisations.

A programming language should be as simple and orthogonal as possible.




Bernd

--
"Die Antisemiten vergeben es den Juden nicht, dass die Juden Geist
haben - und Geld." [Friedrich Nietzsche]
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      04-20-2012
Peter Duniho wrote:
> On Fri, 20 Apr 2012 08:17:52 -0700, Lew wrote:
>
> > Peter Duniho wrote:
> >> Lew wrote:
> >>
> >>> Arved Sandstrom wrote:
> >>>> This is the teens of the 21st century after all.
> >>>
> >>> Quibble: Not until next year.
> >>
> >> Yeah, but you have to take into account the kind of people who insisted
> >> that the new millennium started on Jan 1, 2000. The concept of "teens"
> >> may be more, um...flexible to some people than to others.

> >
> > But it did, by popular acclaim. There is no "real" millennium other than the
> > day after whenever it was hardest to get New Year's Eve hotel reservations at
> > Times Square. [...]

>
> You would be correct, except you're not. If I thought the people making
> the mistake I'm talking about actually understood the point you're making,
> and were just arbitrarily reassigning the term "millennium", you'd have a
> point.
>
> But they don't. They are specifically looking at the count of years and
> falsely imagine that on Jan 1, 2000, two sets of 1000-year intervals have
> passed.


Two sets of 1000-year intervals *have* passed.

Since the year zero. Defined as 1000 years prior to when people first reacted to "the millennium".

You go on and miss the party, Peter. I'll have fun there without you.

--
Lew
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      04-20-2012
glen herrmannsfeldt wrote:
> While we are in the third millenium and the 21st century, I never
> hear anyone say that we are in the 202nd decade. I don't ever
> remember anyone saying we were in the 199th, 200th, or 201st
> decade, either.


I had an argument in 1980 with someone who claimed that 1980 belonged to the 70s, not the 80s. I was responding to an argument that ten belonged in the teens.

These are *linguistic* terms, not scientific ones. They mean what society has them mean, and by the party metric, society deemed 2000 as the beginning of the millennium. I agree.

It's all by convention. I follow that convention, and I am far from alone.

> It seems to me that decades don't count the same way as centuries.
>
> In addition, with a few year uncertainty in the actual date
> that christ [sic] was born, worrying about the difference in millennia
> seems a little strange.


And unnecessary. The "where's the party?" rule completely resolves the problem.

If there's one thing pretty well established, it's that Jesus couldn't have been born on January 1, which was New Year's Day in the pre-Christian era anyway, nor even on December 25. So Christs's birthday has absolutely nothing to do with the discussion.

Zero, like the year that began the millennium count (a.k.a. 1 BC).

--
Lew

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default primitive values from primitive Class<?> object. Daniel Pitts Java 7 10-23-2008 04:30 PM
Java reflection with primitive types Zach Java 2 06-08-2005 02:21 AM
Primitive vs. non-primitive l-value richardclay09@yahoo.co.uk C++ 7 05-09-2005 02:52 PM
Creating primitive data types from contents of String Jesper Sahner Java 13 11-16-2004 02:06 AM
Collections API for primitive types =?ISO-8859-1?Q?S=F8ren_Bak?= Java 0 08-27-2003 06:59 PM



Advertisments