dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Fw: javaByteCode -> IL Compiler


From: Rhys Weatherley
Subject: Re: [DotGNU]Fw: javaByteCode -> IL Compiler
Date: Tue, 08 Jan 2002 09:36:43 +1000

Gaurav Vaish wrote:

> there's another topic of concern -- in IL, interfaces cannot have variables
> while in java an interface may have only constants!

It is possible to create an IL interface with static methods,
variables, and constants.  However, it is impossible to
create such an interface from C# code.  i.e. the engine
can do it, but not the high-level language.  There's some
stuff in the ECMA metadata documentation about this
in section 11, "Semantics of Interfaces".

>     Also, there's problem with switch-case thing... continuous flow in IL is 
> not
> possible, it's same as with or without break!

This is also a language issue.  C#'s switch statements have
an implicit "break" at the end of each case, and you have to
explicitly use "goto case N" to pass control to the next one.

Microsoft claims this is to make switch statements less
dangerous or something.  I think it is more dangerous to
change the construct in a way that would unexpectedly
confuse C/C++/Java programmers.  Whatever.

Behind the scenes, both Java and C# turn switch statements
into a nest of table lookups and branches.  The break statement
doesn't exist in JVM or IL.

These two issues would only be a problem if you were
trying to convert Java source into C# source.  At the level
of JVM -> IL, there shouldn't be a problem.

Cheers,

Rhys.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]