# Friday, 11 April 2003
« More on value types | Main | Snapshot »
More value type feedback

Stuart Ballard commented on yesterday's entry:

I definitely think these changes should be included.

As I understand it, without them it is impossible to use C# structs, enums and other value types in Java code at all, and also impossible to call methods which require ref or out parameters.

This is correct (except that enums were already usable from Java, they are visible as classes containing public static final int fields and arguments are just int arguments).

To me this scenario is very disappointing - the dream of IKVM, for me, was to see Java as a first-class .NET language while still remaining "true java". Eliminating support for value types and reference arguments clashes with the first of these goals; requiring a hacked compiler violates the second.

I'd even go so far as to ask whether it would be possible to actually *write* a "struct" in java, along the lines of the following:

public class JavaStruct extends system.ValueType {
int structMember;
}

Presumably it would be possible for ikvm to detect classes that inherit from ValueType and compile them as structs rather than classes...

I briefly considered it, but dismissed it at the time because I didn't need it. You've convinced me to take another look at this.

To summarize, not only do I think this is cool functionality (even if the implementation *is* a little bit of a hack) I think it's extremely important functionality and I'd like to see further fine-tuning of the "hack" and further enhancements to the functionality, rather than leaving it out entirely.

The reason I didn't comment earlier, though, is that I don't really have any right to comment, as I don't actually use IKVM at all (although I may in the future to save my co-developers from downloading the JRE to run a single java program). I'm only commenting now to provide at least some positive feedback on the idea of checking it in, so that you don't throw it out on the basis that nobody thinks it's valuable (although of course I fully respect your right to throw it out for any other reason).

Thanks for commenting, I really appreciate it! I will go ahead and polish up the changes and check them in.

Friday, 11 April 2003 13:16:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0] Tracked by:
"online poker with no downloading" (online poker with no downloading) [Trackback]

Name
E-mail
Home page

I apologize for the lameness of this, but the comment spam was driving me nuts. In order to be able to post a comment, you need to answer a simple question. Hopefully this question is easy enough not to annoy serious commenters, but hard enough to keep the spammers away.

Anti-Spam Question: What method on java.lang.System returns an object's original hashcode (i.e. the one that would be returned by java.lang.Object.hashCode() if it wasn't overridden)? (case is significant)

Answer:  
Comment (HTML not allowed)  

Live Comment Preview