Related articles |
---|
[4 earlier articles] |
Re: anyone interested in decompilation Juergen.Kahrs@vr-web.de (Juergen Kahrs) (2006-08-10) |
Re: anyone interested in decompilation kym@ukato.freeshell.org (russell kym horsell) (2006-08-11) |
Re: anyone interested in decompilation chris.dollin@hp.com (Chris Dollin) (2006-08-12) |
Re: anyone interested in decompilation Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2006-08-13) |
Re: anyone interested in decompilation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-14) |
Re: anyone interested in decompilation DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-08-14) |
Re: anyone interested in decompilation chris.dollin@hp.com (Chris Dollin) (2006-08-14) |
Re: anyone interested in decompilation barry.j.kelly@gmail.com (Barry Kelly) (2006-08-15) |
Re: anyone interested in decompilation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-15) |
From: | Chris Dollin <chris.dollin@hp.com> |
Newsgroups: | comp.compilers |
Date: | 14 Aug 2006 15:09:23 -0400 |
Organization: | HP labs, Bristol |
References: | <1154507032.629515.108580@m79g2000cwm.googlegroups.com> 06-08-017 06-08-037 06-08-047 06-08-060 06-08-065 |
Keywords: | Java, disassemble |
Posted-Date: | 14 Aug 2006 15:09:23 EDT |
Jürgen Kahrs wrote:
> Chris Dollin wrote:
>
>> [It's handy to use `reference` to mean `pointer without arithmetic
>> opportunities`, but then C++ uses it for something else, not
>> unrelated, again ...]
>
> The Java type "reference" misses not only pointer arithmetic but also
> type casting (of pointers) and the address operator (&). You may of
> course argue that such features are not desirable.
I don't wish to come over as a nit-picker ... [1], but Java /does/
have type-casting of pointers. What it doesn't have is casting
pointers into or out of non-pointers. The need for &address is
much diminished because it would only be useful for primitive
types (since any non-primitive is already accessed via pointers).
Whether or not those features might be /desirable/, I don't know;
I haven't missed pointer arithmetic in Java in general, although
I'd dearly love it at the character-sequence level for lexical
analysis, and would personally rather have multiple-valued expressions
than address-of; both of those features make it, I think, rather harder
to have type-safe implementations, and weren't such implementations
a goal of Java? If I remember correctly -- and it's been a long time --
.NET only allows address arithmetic in unmanaged (hence unsafe) code.
> The absence of
> such feature makes it much harder to write compilers for a translation
> from ISO C to JVM.
Well, yes. This surprises me no more than it being hard to ride
a bicycle on water. The JVM wasn't designed as a general-purpose
implementation environment.
(In fact it /doesn't/ make it harder to write such compilers; it
just makes it harder to write compilers that generate efficient
code. Of course one hopes that C code will be efficient ...)
> The CLR environment of .NET is different in this
> respect. And most other virtual machines treat the concept of a
> pointer as a natural ingredient of a virtual machine.
Probably. I'd like to see the statistics, mind; they'd be
interesting.
[1] Although I probably am one.
--
Chris "seeker" Dollin
"People are part of the design. It's dangerous to forget that." /Star Cops/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.