Re: Which target language do I choose?

cts@bangkok.office.cdsnet.net (Craig Spannring)
26 Jul 1998 15:11:48 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Which target language do I choose? wclodius@aol.com (1998-07-17)
Re: Which target language do I choose? andrew@openkast.com (Andrew Cruickshank) (1998-07-17)
Re: Which target language do I choose? toon@moene.indiv.nluug.nl (Toon Moene) (1998-07-20)
Re: Which target language do I choose? conway@cs.mu.OZ.AU (1998-07-20)
Re: Which target language do I choose? albaugh@agames.com (1998-07-20)
Re: Which target language do I choose? mark@msm.cam.ac.uk (1998-07-24)
Re: Which target language do I choose? cts@bangkok.office.cdsnet.net (1998-07-26)
Re: Which target language do I choose? henry@spsystems.net (1998-07-27)
Re: Which target language do I choose? lkrupp@netONE.com (Louis Krupp) (1998-07-30)
| List of all articles for this month |

From: cts@bangkok.office.cdsnet.net (Craig Spannring)
Newsgroups: comp.compilers
Date: 26 Jul 1998 15:11:48 -0400
Organization: CDS Internet
References: 98-07-094
Keywords: design, C

Thomas Mork Farrelly <Thomas.Mork.Farrelly@nho.hydro.com> wrote:
>
>My current choice is C, and it is fully adequate for the job, but I like
>to consider other possibilities.


C does have some problems for doing low-level programming. (Yes,
I know all the C book writers say otherwise.) C does not allow
the programmer to specify how structures are stored in memory.
For something like


    struct {
        a: char;
        b: short;
        c: long;
    }


the compiler is free to rearrange the fields however it wants. At
least one compiler I used for the i860 rearranged the fields so that
'c' came first, 'b' was second, and 'a' came last in memory.


I don't know if that will be a problem for your language but if it is
you might want to look at Ada. It allows a great deal of control on
how your data is stored in memory.


Of course the problem with Ada is that many compilers try to bring
in a huge run-time library. You will have to look in the compiler
documentation to find out how to build a program without the Ada
runtime to have a minimal foot print.
[If your compiler rearranged the fields, it wasn't a standard
conforming C compiler. Compilers can pack and pad as needed, but the
C89 standard doesn't allow reordering fields in a structure. This
question came up in the standards committee, the answer was
unambiguous. -John]


--


Post a followup to this message

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