where are all the objects?
John Rose
john.r.rose at oracle.com
Fri Jul 22 21:41:26 UTC 2022
On 22 Jul 2022, at 10:17, Kevin Bourrillion wrote:
>
>> Yeah this a bit of a nuisance. It would be nice to have a term that
>> covers both "values" and "instances", because in my mind, and
>> instance
>> is something that gets instantiated. Ephemeral values don't get
>> instantiated, cause they exist. Which means with my view objects of
>> value classes aren't instances (?? this surprised me, but I can't
>> convince myself otherwise anymore).
Instantiation is overrated IMO. One instance of the concept “natural
number” is 42. Either it was never instantiated, or it was
instantiated in some platonic pre-temporal epoch from all eternity
(which some optimizers use to emulate some kinds of immutable data!), or
it was instantiated multiple times, every time someone reached for the
number 42. In the end it doesn’t matter when, just what, 42 is.
Now, take a somewhat larger natural number which is the godelization of
a very large file that you just created for the first time today. Is
that number any older or newer than the *contents* of that file? I
would say they are logically equivalent (one being derivable from the
other) and therefore whatever age-story we make up for one of them
applies quite well to the other (the file content, or the big number
that encodes its information content).
Thus we get the oddity that any kind of file contents (such as that nice
JPG selfie you just took of yourself and your cat) can be
interchangeably viewed as being platonically existent from eternity (but
you just discovered it) or else a new thing created by you (and
theoretically recreated independently by others with similar faces and
cats).
If you hate that idea of discovering rather than making a JPG file, but
accept the idea that 42 is obviously a platonic value, then tell me:
How big does a number have to be before it loses it eternal character
and becomes just another bit of temporary bit-flux in the infosphere?
Because then with your help I can understand why 42 is eternal and your
selfie is temporal. :-)
This is not idle speculation. In fact, when I talk about an
identity-free object in Valhalla, I am talking about something very much
like the contents of your JPG file. Yes, there might be 5 copies of it
in my JVM, but is it a real event when the JIT makes a 6th copy of it
for some reason? Or when the GC collapses them into a single copy (that
clever GC)? It is a real event for the hardware, but should we teach
Java programmers to care about it, or is it just useless distraction?
The godelization argument shows that this puzzle extends smoothly from
tiny things like 8-bit bytes up to large value objects that join
together many smaller values.
>
> I do think "instantiate" often carries a connotation of bringing
> something
> into existence that never existed otherwise, but I'm not sure it
> *should*
> have that connotation. For example `List<String>` is often called a
> "type
> instantiation" of `List<E>`" but nothing was birthed into the world by
> writing that; it was just sort of obtained from the ether.
That “ether” being a pre-temporal epoch such as I mentioned. And
the godelization argument means that, wherever you get (or rediscover)
things like `List<String>` from is very much related to the source of
natural numbers, whatever *that* is.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20220722/cbcb97a1/attachment-0001.htm>
More information about the valhalla-spec-observers
mailing list