Looking for languages that compile to C

ross@spam.maths.adelaide.edu.au (Ross Williams)
Mon, 15 Feb 1993 13:47:43 GMT

          From comp.compilers

Related articles
Looking for languages that compile to C ross@spam.maths.adelaide.edu.au (1993-02-15)
Re: Looking for languages that compile to C moss@cs.cmu.edu (1993-02-18)
Re: Looking for languages that compile to C munk@prl.philips.nl (1993-02-19)
Eiffel for OS/2 fm@sigcomp.sub.org (Frieder Monninger) (1993-02-19)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ross@spam.maths.adelaide.edu.au (Ross Williams)
Keywords: tools, Eiffel, question
Organization: Stats Pure & Applied Maths, Uni of Adelaide, Australia
Date: Mon, 15 Feb 1993 13:47:43 GMT


I'm assisting a Government Department to set up a programming development
environment and as part of that process I'm helping them choose
programming languages.

For a couple of years I've been wavering between Ada and C/C++. In my
view, for most programming, Ada is obviously better (don't flame me - I
already KNOW that many people disagree with this), but the world has
grasped C so firmly and there are so many compilers for it, and so many
libraries for it, and so much support for it, that it seems to have become
compulsary :-) Certainly, the Government Department seems pretty
enthusiastic about it, and would probably consider it a "courageous
decision" not to use it.

Anyway, it occurred to me that, given that everyone has to live with C, it
might be that the best compromise is to find some nice clean language
whose compiler is written in a portable subset of C and which compiles
down to a portable subset of C. This would have the following advantages:

      * Most of the time we wouldn't have to program in C. We could use a
      civilized typesafe language with lots of nice object orientedness and
      so on.

      * But if we needed to use a C library, Unix interface, or do some
      grotty hacks, we could temporarily break through and use C.

      * Code written in the higher language would be MORE portable than C code
      because it is GUARANTEED to compile to a portable subset of C (whereas
      a C programmer might inadvertently do something non-portable). So
      you get the best of the high-level portability of Ada
      (well-definedness), and the pragmatic practical portability of C
      (a compiler on almost every existing Von Neumann architecture machine :-).

A quick look around reveals the language Eiffel (which compiles to C) and
which seems to be even better than Ada (perhaps far better). I have read
Betrand Meyer's book "Object-oriented Software Construction" and was very
impressed. However, I just peeked in comp.lang.eiffel and found [an article
saying that Eiffel seems to be moribund. -John]

Anyway, I think it would be great if there was a civilized language out
there for which compilers exist that compile down to C. Does anyone know
of any others besides Eiffel? I'm looking more for civilized 3GLs than
constraining 4GLs designed for screen design and query lookup.

Feel free to post replies, but please be sure to email them to me too as I
may not get to see all the postings in the groups I post to - we have a
fairly short news lifetime here. Also, unless you specify otherwise,
emailing me will constitute permission to reproduce your email publicly in
postings, compendiums, FTP archives and so on that I may wish to create on
this topic. Email me if you want a summary of replies.

Thanks very much,

Ross Williams

PS: I'm sure many C hackers will object to my use of the word "civilized".
However, think about this. I have a friend (a competent but not too
experienced programmer) who programs in a primitive BASIC using GOSUBS and
GOTOS and so on. He understands the power C could give him and wants the
power, but he treasures too much the way the BASIC interpreter clearly
identifies his programming errors (as opposed to blowing the machine
apart). As for me, I have learnt to live with C through subversive
techniques such as using my own heap manager that places check bytes at
the ends of allocated blocks, and by including magic numbers and checksums
in instances of supposedly closed abstractions.

Post a followup to this message

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