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


Groups > comp.lang.java.programmer > #39677 > unrolled thread

JSR 401

Started byEric Sosman <esosman@comcast-dot-net.invalid>
First post2021-04-01 08:13 -0400
Last post2021-04-02 15:36 +0200
Articles 6 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  JSR 401 Eric Sosman <esosman@comcast-dot-net.invalid> - 2021-04-01 08:13 -0400
    Re: JSR 401 Mostowski Collapse <janburse@fastmail.fm> - 2021-04-01 16:44 +0200
    Re: JSR 401 "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2021-04-01 08:31 -0700
      Re: JSR 401 Arne Vajhøj <arne@vajhoej.dk> - 2021-04-01 18:52 -0400
        Re: JSR 401 "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2021-04-01 19:58 -0700
    Re: JSR 401 Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2021-04-02 15:36 +0200

#39677 — JSR 401

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2021-04-01 08:13 -0400
SubjectJSR 401
Message-ID<s44dd0$vcg$1@dont-email.me>
Has anyone else studied the working drafts of the forthcoming JSR 401?
It's an attempt to unify "primitives" and "objects" in a future Java,
making it possible to have a List<int> instead of List<Integer>, or a
Map<short,double> instead of Map<Short,Double>, and so on. It would
also allow arrays of generic types, like JList<String>[], relieving an
irritation that's nagged us since the dawn of generics.

But there's a drawback: Although arrays of objects (even of generic
types) will work, arrays of primitives would no longer be possible!
That is, you could no longer create or use an int[], but would need
to use something like an ArrayList<int> instead. I'm not intimate
with the inner workings of the JVM and I fail to understand some of
the problems the working papers describe, but it has something to do
with the fact that an array knows the type of its elements and a
primitive doesn't actually have a "type" in the sense of belonging to
a class hierarchy.

Unless I've misunderstood (I *hope* I've misunderstood!), this is both
surprising and dismaying. "Surprising" because the principal author of
this section of the JSR is Pola Flori, who's worked on earlier JSR's
that were scrupulous about maintaining backwards compatibility. Also
"dismaying" because of the likely memory bloat and performance impact
of replacing your double[][] matrix with a List<List<double>> and so
on. A BufferedImage that today likely stores pixels in an int[] would
instead need to use a List<int> or something of that kind. I can't
imagine that this would be a Good Thing ...

But as I say, I may have misunderstood. I hope someone more familiar
with JVM internals and more adept at decoding JSL-style language will
study the proposed JSR and tell me I'm completely wrong. It's a work
in progress rather than an official JSR, so you'll find it hosted at

https://enterrasolutions.com/wp-content/uploads/2019/04/000156-0021-000078_2.png

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [next] | [standalone]


#39678

FromMostowski Collapse <janburse@fastmail.fm>
Date2021-04-01 16:44 +0200
Message-ID<s44m7r$rl8$1@solani.org>
In reply to#39677
LoL

Eric Sosman schrieb:
> 
> Has anyone else studied the working drafts of the forthcoming JSR 401?
> It's an attempt to unify "primitives" and "objects" in a future Java,
> making it possible to have a List<int> instead of List<Integer>, or a
> Map<short,double> instead of Map<Short,Double>, and so on. It would
> also allow arrays of generic types, like JList<String>[], relieving an
> irritation that's nagged us since the dawn of generics.
> 
> But there's a drawback: Although arrays of objects (even of generic
> types) will work, arrays of primitives would no longer be possible!
> That is, you could no longer create or use an int[], but would need
> to use something like an ArrayList<int> instead. I'm not intimate
> with the inner workings of the JVM and I fail to understand some of
> the problems the working papers describe, but it has something to do
> with the fact that an array knows the type of its elements and a
> primitive doesn't actually have a "type" in the sense of belonging to
> a class hierarchy.
> 
> Unless I've misunderstood (I *hope* I've misunderstood!), this is both
> surprising and dismaying. "Surprising" because the principal author of
> this section of the JSR is Pola Flori, who's worked on earlier JSR's
> that were scrupulous about maintaining backwards compatibility. Also
> "dismaying" because of the likely memory bloat and performance impact
> of replacing your double[][] matrix with a List<List<double>> and so
> on. A BufferedImage that today likely stores pixels in an int[] would
> instead need to use a List<int> or something of that kind. I can't
> imagine that this would be a Good Thing ...
> 
> But as I say, I may have misunderstood. I hope someone more familiar
> with JVM internals and more adept at decoding JSL-style language will
> study the proposed JSR and tell me I'm completely wrong. It's a work
> in progress rather than an official JSR, so you'll find it hosted at
> 
> https://enterrasolutions.com/wp-content/uploads/2019/04/000156-0021-000078_2.png 
> 
> 

[toc] | [prev] | [next] | [standalone]


#39679

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2021-04-01 08:31 -0700
Message-ID<d3ffdbf3-c580-4f52-b5fa-903cc8d509ben@googlegroups.com>
In reply to#39677
On Thursday, April 1, 2021 at 8:13:31 AM UTC-4, Eric Sosman wrote:
> Has anyone else studied the working drafts of the forthcoming JSR 401? 
> It's an attempt to unify "primitives" and "objects" in a future Java, 
> making it possible to have a List<int> instead of List<Integer>, or a 
> Map<short,double> instead of Map<Short,Double>, and so on. It would 
> also allow arrays of generic types, like JList<String>[], relieving an 
> irritation that's nagged us since the dawn of generics. 
> 
> But there's a drawback: Although arrays of objects (even of generic 
> types) will work, arrays of primitives would no longer be possible! 
> That is, you could no longer create or use an int[], but would need 
> to use something like an ArrayList<int> instead. I'm not intimate 
> with the inner workings of the JVM and I fail to understand some of 
> the problems the working papers describe, but it has something to do 
> with the fact that an array knows the type of its elements and a 
> primitive doesn't actually have a "type" in the sense of belonging to 
> a class hierarchy. 
> 
> Unless I've misunderstood (I *hope* I've misunderstood!), this is both 
> surprising and dismaying. "Surprising" because the principal author of 
> this section of the JSR is Pola Flori, who's worked on earlier JSR's 
> that were scrupulous about maintaining backwards compatibility. Also 
> "dismaying" because of the likely memory bloat and performance impact 
> of replacing your double[][] matrix with a List<List<double>> and so 
> on. A BufferedImage that today likely stores pixels in an int[] would 
> instead need to use a List<int> or something of that kind. I can't 
> imagine that this would be a Good Thing ... 
> 
> But as I say, I may have misunderstood. I hope someone more familiar 
> with JVM internals and more adept at decoding JSL-style language will 
> study the proposed JSR and tell me I'm completely wrong. It's a work 
> in progress rather than an official JSR, so you'll find it hosted at 

Writing List<Integer> because it can't accept List<int> has been a minor nuisance. Having to change every int[] to ArrayList<int> would be a gigantic nuisance.

[toc] | [prev] | [next] | [standalone]


#39680

FromArne Vajhøj <arne@vajhoej.dk>
Date2021-04-01 18:52 -0400
Message-ID<s45ir5$12d5$1@gioia.aioe.org>
In reply to#39679
On 4/1/2021 11:31 AM, e.d.pro...@gmail.com wrote:
> On Thursday, April 1, 2021 at 8:13:31 AM UTC-4, Eric Sosman wrote:
>> Has anyone else studied the working drafts of the forthcoming JSR
>> 401? It's an attempt to unify "primitives" and "objects" in a
>> future Java, making it possible to have a List<int> instead of
>> List<Integer>, or a Map<short,double> instead of Map<Short,Double>,
>> and so on. It would also allow arrays of generic types, like
>> JList<String>[], relieving an irritation that's nagged us since the
>> dawn of generics.
>> 
>> But there's a drawback: Although arrays of objects (even of
>> generic types) will work, arrays of primitives would no longer be
>> possible! That is, you could no longer create or use an int[], but
>> would need to use something like an ArrayList<int> instead. I'm not
>> intimate with the inner workings of the JVM and I fail to
>> understand some of the problems the working papers describe, but it
>> has something to do with the fact that an array knows the type of
>> its elements and a primitive doesn't actually have a "type" in the
>> sense of belonging to a class hierarchy.

> Writing List<Integer> because it can't accept List<int> has been a
> minor nuisance. Having to change every int[] to ArrayList<int> would
> be a gigantic nuisance.

What date is it today?

Arne

[toc] | [prev] | [next] | [standalone]


#39681

From"e.d.pro...@gmail.com" <e.d.programmer@gmail.com>
Date2021-04-01 19:58 -0700
Message-ID<888cb418-f3a9-4f1c-a0f8-95aa0e3465b8n@googlegroups.com>
In reply to#39680
> What date is it today? 
> 
> Arne

Nope, hump day was yesterday.

[toc] | [prev] | [next] | [standalone]


#39683

FromDaniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Date2021-04-02 15:36 +0200
Message-ID<s476l9$fg0$1@dont-email.me>
In reply to#39677
On 2021-04-01 14:13, Eric Sosman wrote:
>
> Has anyone else studied the working drafts of the forthcoming JSR 401?
> It's an attempt to unify "primitives" and "objects" in a future Java,
> making it possible to have a List<int> instead of List<Integer>, or a
> Map<short,double> instead of Map<Short,Double>, and so on. It would
> also allow arrays of generic types, like JList<String>[], relieving an
> irritation that's nagged us since the dawn of generics.
>
> <snip />

You got me there. Hook, line and sinker. *Golfclap* :)

-- 
DF.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web