comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: ADA CORE TECHNOLOGIES ANNOUNCES GNAT-TO-JAVA SYSTEM
Date: 1997/09/18
Date: 1997-09-18T00:00:00+00:00	[thread overview]
Message-ID: <dewar.874622854@merv> (raw)
In-Reply-To: 342002F1.6913@gsfc.nasa.gov


Stephe says

<<I guess I wasn't clear. I do understand that gcc meets my needs; in
fact, I am using it. I've ported the gcc backend to generate assembler
code for the UT69R000 microprocessor. What I meant by getting away from
K&R is that the gcc _source_ is _written_ in K&R style C; for example,
functions are often not declared before they are used (at least in the
user configuration files I was editing). This has bitten me several
times. I tried to include the headers that defined the functions that I
was using, but could not figure out an include order that worked; some
macro or other was always left undefined. I understand that this style
was necessary when gcc was started; K&R compilers were the only
compilers available. And it is precisely this style, together with a
liberal use of preprocessing, that makes gcc operate on so many hosts.>>

  The people who know and maintain this code can read it FAR more easily
  than they could read Ada code. Familiarity is worth a big factor more
  than objective language differences. Yes, if you are an Ada programmer,
  you will have a hard time reading the code, just as the GCC folk have
  a hard time reading the GNAT front end (even though most people consider
  this to be very clearly written code).

<<I understand that there is a _HUGE_ amount of work in truly replacing
the current gcc with an equivalent Ada 95 implementation. I am sure ACT
cannot afford that on its own; that is why I was surprised to hear that
the JVM implementation was not using gcc. Now I have an inkling of why;
the JVM is not similar to a typical processor.>>

  ACT would not think of embarking on such a counter-productive task. Hundreds
  of people contribute to the development, improvement, and maintenance of
  the existing gcc backend, and even if one did waste resources translating
  the backend of gcc into Ada 95, you would just create a dead end branch, 
  that almost no one would pay any attention to. I cannot imagine a less
  worth while expenditure of time.

<<Almost. You have to write some C glue to transform some RTL instructions
that are not directly available in the target architecture (in my case,
I had to simulate indirect addressing). There was enough C involved to
make me wish it was Ada. In addition, when I left stuff out, or just got
it wrong, the only way I could figure out what was missing was reading
the gcc source. It is well commented, and usually well structured, but
it is not Ada 95.>>

  Well no doubt Eiffel programmers would prefer it in Eiffel, Smalltalk 
  programmers would prefer it in Smalltalk, etc, but that is not a reason
  to do any of these translations.

It never makes sense to me to translate code in language A to language B just
for the sake of having the code in language B. Some very silly projects in the
past have done just that where language B was Ada, and it is one of the things
that have unfortunately convinced some people that Ada does not make sense if
it causes such activities to be undertaken.

By the way, if you do a bit of homework and learn JVM, you will see that
the task of generating JVM is not even remotely like the job of generating
machine language. JVM is much closer to Java in semantic level than it is
to machine language. People often think that it would make sense to somehow
have JVM as a target for GCC, but if they think that then they have serious
misconceptions about the GCC backend, or JVM, or both!





  reply	other threads:[~1997-09-18  0:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-11  0:00 ADA CORE TECHNOLOGIES ANNOUNCES GNAT-TO-JAVA SYSTEM Robert Dewar
1997-09-12  0:00 ` Stephen Leake
1997-09-13  0:00   ` Robert Dewar
1997-09-14  0:00     ` Ralph Paul
1997-09-14  0:00       ` Robert Dewar
1997-09-16  0:00         ` Brian Rogoff
1997-09-17  0:00           ` Tarjei T. Jensen
1997-09-18  0:00             ` Robert Dewar
1997-09-17  0:00           ` Ralph Paul
1997-09-18  0:00             ` Robert Dewar
1997-09-19  0:00               ` Richard A. O'Keefe
1997-09-19  0:00                 ` Jon S Anthony
1997-09-20  0:00                   ` Jay Han
1997-09-22  0:00                   ` Richard A. O'Keefe
1997-09-20  0:00                 ` Robert Dewar
1997-09-21  0:00                   ` Fergus Henderson
1997-09-22  0:00                     ` Robert Dewar
1997-09-16  0:00         ` Ralph Paul
1997-09-15  0:00     ` Stephen Leake
1997-09-15  0:00       ` Mark L. Fussell
1997-09-16  0:00       ` Robert Dewar
1997-09-17  0:00         ` Stephen Leake
1997-09-18  0:00           ` Robert Dewar [this message]
1997-09-19  0:00             ` translating to Ada, was " Tom Moran
1997-09-19  0:00             ` W. Wesley Groleau x4923
1997-09-20  0:00               ` Robert Dewar
1997-09-23  0:00                 ` multi-language to JVM compilers? W. Wesley Groleau x4923
1997-09-16  0:00       ` ADA CORE TECHNOLOGIES ANNOUNCES GNAT-TO-JAVA SYSTEM Tucker Taft
1997-09-17  0:00         ` Robert Dewar
1997-09-13  0:00   ` Tarjei T. Jensen
1997-09-14  0:00     ` Robert Dewar
1997-09-14  0:00       ` Tarjei T. Jensen
1997-09-15  0:00         ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-09-15  0:00 Marc Wachowitz
1997-09-20  0:00 Marc Wachowitz
1997-09-21  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox