Hello,

I am trying to understand what barriers, if any, exist to supporting C-
style structs in JVM languages.  I have considered trying to add
support of such to Clojure for my own research programming (I work on
local search algorithms for bioinformatics applications).  I assume
that the right way to do this will involve emitting byte code, but I
have not yet studied the byte code or its verification by the JVM in
enough detail.  I thought this group might be able to answer the
following questions before I invest time in a fruitless search for a
good solution:

1) Is there any inherent limitation in the bytecode, or the JVM
verification algorithm, which makes it impractical to represent
structured, non-reference types?  Intuitively it seems that functions
and operations on structs are reducible to functions and operations on
basic types (int, float and friends).  But, while C# supports structs,
Java does not and I have not seen any indication that it will, and I
have not seen a JVM language which does either.  (Maybe Scala does?
Not familiar enough with it to be sure).  I can't tell if this is just
for "religious" reasons, but it seems to me an obviously useful
feature and there should be a good reason it isn't included.

2) If this has already been implemented for some language, can someone
provide a link to details of how it was implemented?

This feature is very important for certain algorithmic applications,
where one wants to store a very large number of small records -- the
memory/performance penalty (especially memory) of having one or more
extra pointers per record using reference types (Objects) is really
frustrating.  I'm sure this must be well-trodden ground for JVM
language implementors but I haven't been able to track down a
comprehensive discussion online.

Many thanks in advance for your insights,

Joe

--

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