Re: Java virtual machine as target language for C/C++

dean@psy.uq.oz.au (Dean Povey)
10 May 1996 01:38:04 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Java virtual machine as target language for C/C++ kik@zia.cray.com (1996-05-08)
Re: Java virtual machine as target language for C/C++ billms@nixon.icsl.ucla.edu (1996-05-08)
Re: Java virtual machine as target language for C/C++ sal714@rs710.gsfc.nasa.gov (1996-05-08)
Re: Java virtual machine as target language for C/C++ bnm@indica.bbt.com (1996-05-10)
Re: Java virtual machine as target language for C/C++ mbk@caffeine.engr.utk.edu (1996-05-10)
Re: Java virtual machine as target language for C/C++ Drinie@xs4all.nl (1996-05-10)
Re: Java virtual machine as target language for C/C++ dean@psy.uq.oz.au (1996-05-10)
Re: Java virtual machine as target language for C/C++ khays@sequent.com (1996-05-13)
Re: Java virtual machine as target language for C/C++ genew@mindlink.bc.ca (1996-05-13)
Re: Java virtual machine as target language for C/C++ pardo@cs.washington.edu (1996-05-14)
Re: Java virtual machine as target language for C/C++ dmoisan@shore.net (1996-05-14)
Re: Java virtual machine as target language for C/C++ rfg@monkeys.com (1996-05-19)
Re: Java virtual machine as target language for C/C++ moresys@world.std.com (1996-05-19)
[10 later articles]
| List of all articles for this month |
From: dean@psy.uq.oz.au (Dean Povey)
Newsgroups: comp.lang.java,comp.lang.c++,comp.compilers
Date: 10 May 1996 01:38:04 -0400
Organization: University of Queensland
References: 96-05-036
Keywords: Java

Drinie@xs4all.nl (Rinie Kervel) writes:


>I know that Java does not support pointer arithmetic.


>But as the Java virtual machine gets integrated in many OSes it would
>be nice to use it as a target language for other languages.


>Is it possible (and will Sun allow it) to extend the JVM to support
>pointer arithmetic.


>Some notes:
>- Not every application is required to be secure
> (You could trust your own programs, just as you have to
> trust your web browser :)


>- Most pointer arithmetic can just as well be bounds checked:
> just as you can say that
> for an array a[100] a[i] is only valid if 0 <= i && i < 100


> For a pointer you can define a low address and a high addres
> and test after each operation on the pointer if it still lies
> between these bounds or is NULL (and may not be dereferenced)




It would be certainly be possible to emulate pointer addressing in
Java Byte code. Even if you just simply allocate a big array of char
and write conversion routines. Of course there are other restrictions
on the byte codes which allow it to be verified at load time which may
cause problems for some C code, but there is probably nothing that
couldn't be sorted out by an emulation layer.


There wouldn't be any speed up of course but it would open up a lot of
legacy code.


Dean.
[I still don't see why people want to turn their big ol' C programs into
Java applets to export to Web browsers. -John]


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.