RFR: 8376223: Add modeling interfaces for algebraic structures: groups, rings, and fields
Brian Goetz
briangoetz at openjdk.org
Sat Jan 24 17:17:22 UTC 2026
On Sat, 24 Jan 2026 05:14:16 GMT, Vladimir Kozelkov <duke at openjdk.org> wrote:
>> First cut at adding modeling interfaces for the algebraic structures of rings, groups, and fields.
>
> I apologize for writing this here, but I'm concerned about why operators are so narrowly grouped together. And why aren't the operand and return types separated? These are quite restrictive.
>
> Using this type of operator, it's impossible to emulate, for example, matrix and vector multiplication. Because the operands are different types. And the language already has an example of similar constructs—the string addition operator, which takes a string and something else to produce a string again. I'd like the operator mechanism to be able to fully model the current behavior of the language. So that instead of a rigid construct within the compiler, the string addition operator could be modeled in the same way as other operators.
@vova7878 Such discussions are premature. This PR is an experiment, nothing more. We will take what we've learned from the various experiments and bring them to the actual design discussions, when they happen. But for now, this is just a place to stash an experiment.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1957#issuecomment-3795125797
More information about the valhalla-dev
mailing list