On Thursday 24 April 2008 21:15:54 Ola Bini wrote:
> Value types, yeah. I really do hope John Rose's ideas about tuples will
> get in to the next version of Java...

Incidentally, can I address what appears to be a growing problem here. A lot 
of people (including JVM developers) keep referring to .NET structs and 
tuples as if they are the same thing but they are completely different.

John Rose et al. seem to have repeated this mistake here, for example:

  http://openjdk.java.net/projects/mlvm/pdf/LangNet20080128.pdf

A .NET struct is a value type with an unboxed internal representation. This is 
ideal for representing complex numbers but *not* tuples. A complex array with 
a complex struct is represented by a float array rather than an array of 
pointers to pairs of floats. This offers huge performance improvements in the 
context of numerics without sacrificing clarity.

A tuple is a product type. This says nothing of its internal representation 
that may be boxed or unboxed. Tuples are typically boxed to avoid unnecessary 
per-member copying whenever the tuple is passed around.

For example, F# does not use structs to represent its tuples because this 
would seriously damage performance.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to