Value Types for Java

Ben Hutchison benh at ibsglobalweb.com
Wed Jun 18 01:28:25 PDT 2008


Miles Sabin wrote:
> On Wed, Jun 18, 2008 at 6:15 AM, Ben Hutchison <benh at ibsglobalweb.com> 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.
>>     
> What do you mean here? That a ByteBuffer be viewable as an array of
> (value) objects? 
Yes. Viewable and updatable.

 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 admit it might be difficult to get this to work even 
with value type support, given that Java's philosophy says precise 
memory level representation is undefined by spec)

> Again, I'm really not sure what it is that you want
> to do that you can't already.
>   
Your earlier idea seemed to be that heterogeneous value types would 
translate into multiple side-by-side arrays accessed in unison. Most 
external processes you might want to interact with aren't going to 
"think" that way. They would typically expect to find fields of a 
related struct next to each other.

(Granted you did mention a  single array encoding for homogenous types, 
but I am concerned thats too fragile in practice - the moment it becomes 
heterogenous, the encoding scheme totally changes.)

So, you could have one encoding of a given value type to/from 
ByteBuffer, and another otherwise, but that seems messy.

You surely agree that your proposal represents a (worthy) workaround to 
work in current JVM architectures, and not the ideal solution?

-Ben

-- 

	

*Ben Hutchison
Senior Developer
* Level 2 476 St Kilda Road Melbourne VIC 3004
T 613 8807 5252 | F 613 8807 5203 | M 0423 879 534 | 
www.ibsglobalweb.com <http://www.ibsglobalweb.com/>

This e-mail (and any attachments to this e-mail) is for the exclusive 
use of the person, firm or corporation to which it is addressed and may 
contain information that by law is privileged, confidential or protected 
by copyright. If you are not the intended recipient or the person 
responsible for delivering this e-mail to the intended recipient, you 
are notified that any use, disclosure, distribution, printing or copying 
of this e-mail transmission is prohibited by law and that the contents 
must be kept strictly confidential. If you have received this e-mail in 
error, kindly notify us immediately on + 613 8807 0168 or respond to the 
sender by return e-mail. The original transmission of this e-mail must 
be destroyed.

Internet Business Systems Australia Pty Ltd accepts no responsibility 
for any viruses this e-mail may contain. This notice should not be removed.





More information about the mlvm-dev mailing list