From: "John Jardine"
Subject: Re: Which basic compiler to buy?
Date: Wed, 11 Dec 2002 03:46:19 -0000
NNTP-Posting-Date: 11 Dec 2002 03:33:53 GMT
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
Jonathan Kirwan wrote in message
> On Tue, 10 Dec 2002 19:49:17 -0000, "John Jardine"
> >Stay clear of the C!.
> Bad recommendation for some folks.
> >It's an obtuse and unfriendly language having little
> >correspondance with good machine code routines.
> C was originally designed (as an outgrowth from BCPL and
> Thompson's B) to produce very easy conversion (translation) to
> PDP-11 machine code which would compete well with hand-written
> assembly. Whether or not it achieves all of this for other
> architectures is debatable. But it was a balance designed to
> repair some of B's lacks exposed by the PDP-11, to convert
> directly to machine code instead of threaded code, and to allow
> prosaic compiler techniques to produce good code for the PDP-11.
> I think you overreach in your statement and I'd like to see a
> specific demonstration illustrating your point.
> >It is only pre-eminent nowadays due to it being found to be so awkward to
> >use that it was gladly taken up by the colleges and microsoft.
> That wasn't my exact experience.
> Unix version 6 played a significant role in spreading the use of
> C to the world. In fact, that was exactly why I started
> learning C in 1978. In addition, C appeared on the DEC VAX
> computers in 1980 (if memory serves) and I used it there (along
> with VAX BASIC, Fortran, COBOL, Macro-32, and BLISS-32.)
> I can't be sure of the exact timing of various C compilers for
> other processors, such as the Manx Aztec C compiler for the 6502
> (Apple II was more popular than the PC until circa 1984 -- my
> partner used to track these changes closely.) But you
> incorrectly imply that Microsoft introduced C for the PC, as
> well. Just to be clear about that, Microsoft's C was Lattice C
> until about MSC 4.0, I believe (which I still have somewhere in
> boxes.) Lattice also continued to sell their own C compiler up
> through some 6.x version -- I still use their version 3.1 for an
> existing product, if you can believe it. There was Wizard C,
> and Datalight C, and Ecosoft, and DeSmet, and Manx Aztec C
> (though I'm not sure if that's my 6502 memory working), to name
> just some more.
> The popularity of C was driven by those programmers who chose to
> *use* it, because it was an excellent choice. Microsoft got
> into the act because it was showing itself to be a profitable
> marketplace to be. Contrary in some way to your suggestion
> above, it was not Microsoft which made C popular, but the
> programmers who chose to use C for Unix, for VAX VMS, for Apple
> 6502, and for IBM PC development which made C popular. C
> 'spoke' well to application developers competing hard for
> business. It worked well and once that was demonstrated people
> flocked to it in droves. Microsoft came into the market by
> buying it's way in, only after the fact.
> Microsoft's BASIC (whether sold by IBM or Microsoft) was *the*
> professionally used package, together with the assembler tool,
> early on. I used their BASIC compilers to develop more than one
> successful nationally marketed software package, circa 1983 and
> 1984, for the PC. (I was quite familiar with C by this time and
> would have selected it instead of BASIC had it been available in
> professional grade at the time.) But BASIC lost out to a
> growing C market because, quite frankly, companies found C to be
> a better tool for many important applications: Microsoft,
> included, by the way.
> C did what it did because it was a good tool.
> >A normal PC prog' written in classical Basic (not the present C-Basics eg
> >VB) can be rewritten or 'broken down' line by line, statement by
> >and expanded to a sufficiently detailed level that can translate
> >across to a PIC or other micro's machine code . Essentially a Basic
> >programme is a line by line, condensed, idealised, equivalent of a
> >code programme.
> > Thus a PIC Basic compiler can be written to make use of this easy
> >correspondance between a Basic statement and it's machine code equivalent
> >and can be very efficient.
> I'll restrict my opinions to comments on C, for now.
> >A 'C' programme and it's strange 'structuring' will not readily do this
> >the corresponding PIC 'C' compilers have to go round and round the
> >to try and provide the same PIC (or another micro) machine code
> I'd enjoy seeing you demonstrate this point, as well. Frankly,
> it makes no sense to me and smacks of just more propaganda
> without a basis, though.
> Make your point with detail, if you can.
Jon, as you've got extensive experience of both languages you've caught me
in a pincer movement and I shouldn't really have a leg to stand on. ;-).
You're right though, in that I am offering up propaganda (baseless or not).
I try and redress a massive overbalance in the perception that the C offers
all things to all men (and women). It's a small cry in the wilderness but I
feel it should be heard.
There's also no way that I can supply a specific example, or demonstration
of a problematic piece of 'C' that is better made in Basic, as I simply do
not programme in C.
(Much as I'd love to!), I just don't have sufficiently detailed knowledge to
offer up some clever/underhand/scurrilous Basic-C comparison or
demonstration, that could be argued over for an eternity.
Basic and C comparisons do though regularly turn up in other 'language'
NG's and as they are supplied by crafty programmers they argue a similar
case far more elequently than I ever could.
I do though 'look in' regularly to see if the C language in its various
forms has developed any 'clarity' and I do not have to be a programmer to
discover more impenetratabilty more complexity, more 'structures' more
But ... I am not a programmer. I'm just a hack designer of electronic kit.
I use the programming purely as a tool to pursue an end. If a language does
the job quickly and efficiently then I'm happy.
I dislike parts of Basic. I also dislike the PIC machine code instruction
set but both are simple and effective so I use them.
The OP though, asked about the worth of a C compiler for the PIC, as an aid
to avoid writing lots of tedious PIC assembler.
This narrows the field of interest away from PDPs, computer architectures,
commercial programming, Unix, IBM, Apple, and even microsoft, to that of
simply writing a few lines of text to perform relatively simple PIC micro
related 'tasks' that will compile to a small PIC hex file using 30 different
Over the past two years, I've inspected a number of sample programmes
provided by PIC Basic and PIC C compiler suppliers and I still find that the
supplied PIC C code samples are (in my opinion of course!) obtuse and
unfriendly. Basic can be read by any programmer. C can only be read by a C
Efficiency of final compiled code can only be discovered by the user. Yet
again though I argue that simplicity of a PIC Basic source *will* translate
into simplicity of PIC object code.
I've one concrete example of C's abstruse nature. 18 months ago, I supplied
an equipment to a consultant embedded systems engineer. He told me he
couldn't immediately integrate it in to his main project as he was having
problems with his control programme. Took a two further weeks before he
cleared the problem (he'd already spent a week on it). He was programming in
a C for the control micro (some 16 bit type) and was finally embarrassed to
tell me that the problem was an erroneous "numeric type". That's 15 days at
600UKP per day. He also told me that this kind of C problem was not