Question about Java and Arithmetic
Jonathan Bluett-Duncan
jbluettduncan at gmail.com
Wed Mar 21 02:45:42 UTC 2018
Hi A Z,
I assume you're responding to my earlier response over at
http://mail.openjdk.java.net/pipermail/adoption-discuss/2018-March/001731.html
?
No, from what I've observed of the valhalla lists (see bottom of
http://mail.openjdk.java.net/mailman/listinfo), there is purposely no
effort yet to introduce "numeric decimal and integer types, of a larger
range". (I assume you mean something like BigInteger or BigDecimal, but as
primitives instead of objects.) Neither has there been any apparent effort
yet to introduce operator syntax (like +,-,*,/) for such types.
I believe the reason for this is that Brian Goetz et al. are finding value
types themselves so hard to introduce into Java and to integrate with
everything else already, that they're focusing on getting the building
blocks for values out of the door before writing up any actual value types
(like value-ified Big(Integer|Decimal) or char's successor).
As for operator syntax for custom types, I can only imagine that that would
complicate things in Valhalla further, as value types touch virtually
everything in the language and JVM! Also, Brian Goetz et al. are so
mentally strained by Valhalla, Amber, etc. that I think it'll be a *long* time
before custom operator syntax ever comes, if it ever does.
As Martijn mentioned at
http://mail.openjdk.java.net/pipermail/adoption-discuss/2018-March/001732.html,
it will probably take a good few Java releases more before Project Valhalla
reaches it's conclusion - it's *that* hard to piece together, it seems! :)
I hope this helps!
Cheers,
Jonathan
On 21 March 2018 at 02:26, A Z <poweruserm at live.com.au> wrote:
> -From my point of view, it's not just avoiding floating points "leaks",
> but it's having a numeric decimal and integer type, of a larger range,
> that I can use
> operator syntax on, and convert to and from the double and float types.
>
>
> Is there anything like that in Java 10, or coming up in Java,
> either via value types or anything else?
>
>
More information about the adoption-discuss
mailing list