where are all the objects?

Brian Goetz brian.goetz at oracle.com
Fri Jul 22 23:11:50 UTC 2022


Instantiation is overrated IMO.

I like the notion of “summoning”.  You can summon Foo.default or 42 or “foo” without appeal to instantiation; for an indentity class, new Foo() summons a guaranteed-unique entity; for a value class, new Foo() summons a value that you may or may not have seen before.

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.

Because classes have been identity classes forever, we easily conflate “summon” with “summon new and forever unique instance”, which is largely equivalent to “allocate”.  So I think we have to adjust our notion of “instantiation” or whatever we call it to e more like “get me a value; depending on the classes involve, it might be new, it might be old.”


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20220722/d8336a3a/attachment.htm>


More information about the valhalla-spec-observers mailing list