[vox-tech] Compiling C into Java bytecode?

Ken Bloom vox-tech@lists.lugod.org
Sun, 29 Jun 2003 14:06:57 -0700


--8t9RHnE3ZwKMSgU+
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


On 2003.06.29 04:51, Rod Roark wrote:
> On Sunday 29 June 2003 02:32 am, Bill Kendrick wrote:
> > Okay, just out of curiosity.  Say one wanted to create a 'Java
> application'
> > (e.g., something that runs in a web browser, cell phone or PDA JVM),
> > but they wanted to write the application using the C /language/.
> >
> > This is possible, is it not?  If so, are there some tools for this
> > under Linux?  (I see "gjc", the Java compiler from GNU, as well as
> > "gij", the Java bytecode interpreter from GNU; but nothing for
> > taking code in other programming languages and turning them into
> Java
> > bytecode)
>=20
> I don't know of any way to do that, nor why anyone would
> want to.  Java syntax already resembles C quite a bit.
>=20
> Tell them to write it in C, run it through a Java compiler,
> and fix the parts that don't work.  :-)

This is totally not possible.

First, many important syntactic features of C don't work in Java
(structs, for example, pointer dereferences for another). Second, their=20
standard libraries have very different names for most things (even=20
something so simple as the sine function has two different incompatible=20
lines to call it in the two different languages - in c it's sin() , and=20
in java it's Math.sine() ). So I can't even copy/paste strictly=20
mathematical functions between the two languages.
--=20
I usually have a GPG digital signature included as an attachment.
If you don't know what it is, either ignore it or visit www.gnupg.org
My PGP key was last signed 6/10/2003 please download my key again if
it is more recent than your copy. If you use GPG, *please* talk to
me to sign it. The key is keyID E2B2CAD1 on pgp.mit.edu
--8t9RHnE3ZwKMSgU+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+/1TxlHapveKyytERAqs/AJ0TZcndYhMNSfhlPO0zVZXlMBD2WQCfT3wg
neMSEH0gQSAOWzppa1rQhKw=
=RVuO
-----END PGP SIGNATURE-----

--8t9RHnE3ZwKMSgU+--