Re: Value Types for Java

2008-06-25 Thread Ben Hutchison
Kenneth Russell wrote: > I would be concerned about the semantic change of > pass-by-value and what that would mean for the easy readability and > understanding of Java source code I would point to the CLR as a successful example here. Value types and references types mingle fairly painlessly i

Re: Value Types for Java

2008-06-25 Thread Ben Hutchison
Miles Sabin wrote: > On Wed, Jun 18, 2008 at 9:28 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > >> The example case I have in mind is an interaction between a Java >> process and a 3D graphics driver. Eg a Java process would be >> writing/updating triangle data in the buffer, and the graphics d

Re: Value Types for Java

2008-06-19 Thread Miles Sabin
On Wed, Jun 18, 2008 at 9:28 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > The example case I have in mind is an interaction between a Java > process and a 3D graphics driver. Eg a Java process would be > writing/updating triangle data in the buffer, and the graphics driver > rendering it. (I admi

Re: Value Types for Java

2008-06-18 Thread Kenneth Russell
It's possible to do what you want with the existing NIO Buffer classes and a helper tool. GlueGen (http://gluegen.dev.java.net/) generates Java classes to access C data structures. These accessor classes wrap ByteBuffers and provide setter / getter methods for accessing the fields of the struct

Re: Value Types for Java

2008-06-18 Thread Ben Hutchison
Miles Sabin wrote: > On Wed, Jun 18, 2008 at 6:15 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > >> Also, in terms of what it doesn't do: >> >> 1. Hard to see any way to extend to interpret a ByteBuffer region as an >> array of some value type, a feature ultimately needed for bulk interop >> wit

Re: Value Types for Java

2008-06-18 Thread Miles Sabin
On Wed, Jun 18, 2008 at 6:15 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > Also, in terms of what it doesn't do: > > 1. Hard to see any way to extend to interpret a ByteBuffer region as an > array of some value type, a feature ultimately needed for bulk interop > with external IO/processes, I feel

Re: Value Types for Java

2008-06-17 Thread Ben Hutchison
Miles Sabin wrote: > On Tue, Jun 17, 2008 at 5:42 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > >> Ive written up a post outlining my case for value type support: >> http://benhutchison.wordpress.com/2008/06/15/the-jvm-needs-value-types/ >> > > Surely, in that very article you describe the

Re: Value Types for Java

2008-06-17 Thread Miles Sabin
On Tue, Jun 17, 2008 at 5:42 AM, Ben Hutchison <[EMAIL PROTECTED]> wrote: > Ive written up a post outlining my case for value type support: > http://benhutchison.wordpress.com/2008/06/15/the-jvm-needs-value-types/ Surely, in that very article you describe the exact encoding that's needed to get al