Value-Based Classes vs Value Types

Nicolai Parlog nipa at
Sun Feb 15 16:52:33 UTC 2015


I'm currently writing a post about value-based classes warning people
about what not do with them and why those limitations exist. Now that
the article is more or less done, I realize that it heavily relies on
a concrete idea of how the relation of value-based classes and value
types looks like.

The State of the Values from 04/2014 [1] says "In fact, it seems
likely that the boxed form of every value type will be a value-based
class." If I understand this correctly, it's like we're implementing
'Integer' now, waiting for 'int' to be implementable in a couple of

Or is it more like we are already writing the value types, waiting for
the language to catch up so we can then add the right qualifiers and
effectively transform value-based classes into value types? To
continue the example from above, do we currently write Integer but by
replacing "public class Integer" with "public value integer" (syntax
is irrelevant) we effectively create 'int', leaving all other code
untouched (because we followed all the rules)?

Do even more options exist? Btw, I'm not asking this to get a detailed
picture of how it's gonna be. I'm rather looking for an explanation
which I can repeat (and is not already known to be wrong) for how
value-based classes relate to value types and why this creates the
documented limitations.

 so long ... Nicolai



PGP Key:

        a blog about software development
        Free and Open Source Software for the City of Dortmund


More information about the valhalla-dev mailing list