What is the best C compiler?

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
GroovyBee
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 143
Joined: Thu Oct 16, 2008 1:23 pm
Location: North, England

What is the best C compiler?

Postby GroovyBee » Mon Oct 27, 2008 6:21 pm

First some history: When I wrote code on the ST back in the day it was mainly in assembler and GFA basic. I remember messing about with a public domain C compiler (can't remember its name :( ) and some Pascal too. The C compiler wasn't very fast on my humble 520 so it was dumped for the excellent DevPac assembler system and I never looked back.

Now: I have some homebrew C games (with some target specific assembly language for graphics handling) that I'd like to port to the ST. How good did the C compilers get? What is the best one in terms of producing binaries for speed/size? Opinions and recommendations please.

User avatar
Mug UK
Administrator
Administrator
Posts: 11227
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: What is the best C compiler?

Postby Mug UK » Mon Oct 27, 2008 6:26 pm

From memory, there were only 2 commercial offerings: Lattice C (v5.5 being the most recent?) and Pure C. You're best bet is to talk to the likes of Nyh (amongst others) to see what they use.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

Re: What is the best C compiler?

Postby thothy » Mon Oct 27, 2008 8:58 pm

Pure-C is really good. You can get it here:

http://rg.atari.org/CODE/PURE_C.ZIP

User avatar
GroovyBee
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 143
Joined: Thu Oct 16, 2008 1:23 pm
Location: North, England

Re: What is the best C compiler?

Postby GroovyBee » Mon Oct 27, 2008 9:13 pm

thothy wrote:Pure-C is really good. You can get it here:


Thanks for that.

Yay! Its from Borland :D . I used to love Borland 3.1. It was really good at code generation on my old 486.

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: What is the best C compiler?

Postby Desty » Tue Oct 28, 2008 2:18 am

GroovyBee wrote:First some history: When I wrote code on the ST back in the day it was mainly in assembler and GFA basic. I remember messing about with a public domain C compiler (can't remember its name :( ) and some Pascal too. The C compiler wasn't very fast on my humble 520 so it was dumped for the excellent DevPac assembler system and I never looked back.

Probably Sozobon C? That's what I used to use - still got a build on floppy. Not too bad really; but yeah, slow as hell.
tá'n poc ar buile!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is the best C compiler?

Postby Nyh » Tue Oct 28, 2008 9:37 am

GroovyBee wrote:Now: I have some homebrew C games (with some target specific assembly language for graphics handling) that I'd like to port to the ST. How good did the C compilers get? What is the best one in terms of producing binaries for speed/size? Opinions and recommendations please.

There are three good compilers for the ST. Pure C, Lattice C and GCC. GCC has the best optimizer. Pure C makes the best use of the address registers but you have to write code for it. As development tool Pure C is by far the best. The Pure debugger is really great. One little point to be ware of: in Pure C an int is 16 bit.

I do most programming with Pure C, even assembly. Mixing assembly with C code is really simple.

Hans Wessels

User avatar
GroovyBee
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 143
Joined: Thu Oct 16, 2008 1:23 pm
Location: North, England

Re: What is the best C compiler?

Postby GroovyBee » Tue Oct 28, 2008 10:44 am

Desty wrote:bably Sozobon C? That's what I used to use


That's the one! It was truly awful developing on a 2 floppy system with Sozobon.

Nyh wrote:There are three good compilers for the ST. Pure C, Lattice C and GCC. GCC has the best optimizer.


I've used GCC on ARM for years. Its optimisation level is good if you write code that's biased to the way GCC likes. Its still a long way off hand optimised assembler. I've downloaded Pure C and will have a look at it when I get some time. Any ideas where I can get Lattice C and an Atari build of GCC?

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: What is the best C compiler?

Postby Desty » Tue Oct 28, 2008 11:23 am

GroovyBee wrote:That's the one! It was truly awful developing on a 2 floppy system with Sozobon.

I had 4 megs of RAM, so after a while of being frustrated by disk swapping, I built a big self-extracting archive (about 500-600k compressed on one floppy) of the entire system.
When I booted up my STFM to do some programming in Sozobon, I'd create a compressed ramdisk (Maxidisk) of around 1500k (which would probably hold over 2mb) and extract the archive into it, then load the shell (pcommand or something simple; gulam never worked properly for me) and get going.
It was much, much faster running the compiler from a ramdisk (well, iirc a "hello world" might take 10-20 seconds), and if my dodgy code crashed the Atari, the ramdisk was resetproof anyway so it didn't take too much time. However, I sucked at C programming back then, and never made anything useful :oops:
tá'n poc ar buile!

User avatar
GroovyBee
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 143
Joined: Thu Oct 16, 2008 1:23 pm
Location: North, England

Re: What is the best C compiler?

Postby GroovyBee » Tue Oct 28, 2008 12:01 pm

Desty wrote:However, I sucked at C programming back then, and never made anything useful :oops:


I only created a 6800 cross assembler in C on the ST to help me at uni. All my other projects were in 68000 assembler or GFA BASIC. I only had a 520 at the time so the move over to DevPac made my life much more fun.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2105
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: What is the best C compiler?

Postby charles » Wed Oct 29, 2008 11:04 am

what about the mark williams mwc

is it any good i got it and a manual but have zero skills in c .

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is the best C compiler?

Postby Nyh » Wed Oct 29, 2008 12:24 pm

charles wrote:what about the mark williams mwc

is it any good i got it and a manual but have zero skills in c .

AFAIK Mark Williams C is not a ANSI C compiler. This makes it totally useless, especially for you.

Hans Wessels

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2105
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: What is the best C compiler?

Postby charles » Wed Oct 29, 2008 10:07 pm

i was given this compiller by a fairily good and established individual whom had success with the program he made and sold..

why is it no good to me?

charles
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: What is the best C compiler?

Postby Desty » Wed Oct 29, 2008 10:48 pm

charles wrote:why is it no good to me?

Probably because
charles wrote:i got it and a manual but have zero skills in c .

Also, it's a pretty bad idea to switch languages again after already jumping around Pascal/ST Basic/GFA Basic/assembly repeatedly and too quickly (to learn much).
tá'n poc ar buile!

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is the best C compiler?

Postby Nyh » Wed Oct 29, 2008 11:21 pm

charles wrote:i was given this compiller by a fairily good and established individual whom had success with the program he made and sold..

why is it no good to me?

Because it is not an ANSI C compiler. It is a bad idea for anybody to use a non-ANSI C compiler when there is an ANSI C compiler available. Especially for a beginner. ANSI C has a lot of advantages over the old K&R C.

As for you Charles: your current understanding of programming is far below the level you need to be successful in learning C.

Hans Wessels

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 838
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: What is the best C compiler?

Postby jfl » Thu Oct 30, 2008 11:19 am

charles wrote:what about the mark williams mwc

is it any good i got it and a manual but have zero skills in c .

This ain't obsolete enough. You should try to get hold of Alcyon C.
Jean-François
GEMDict – GEMClip

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2105
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: What is the best C compiler?

Postby charles » Thu Oct 30, 2008 10:44 pm

nope do noy have alcyon c
i have enough troubles allready ,
for some reason me and c are like
cats and dogs..kow what i mean?

too much {} for me and all new context.

charles but wouldnot mind this aluycon c for my vast ensenble of languaugaes..

i could then even call my self a c programmer ...i have dozen or so learn atari c books
if anybody has nothing to do and wishes to maybe write up a little demo in c with me...
atari is my lifestyle,not a hobby.
HOLD ON ! ! !,
Im printing unreadable characters ...!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2265
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: What is the best C compiler?

Postby lp » Mon Nov 03, 2008 7:27 am

charles wrote:nope do noy have alcyon c
i have enough troubles allready ,
for some reason me and c are like
cats and dogs..kow what i mean?

too much {} for me and all new context.

charles but wouldnot mind this aluycon c for my vast ensenble of languaugaes..

i could then even call my self a c programmer ...i have dozen or so learn atari c books
if anybody has nothing to do and wishes to maybe write up a little demo in c with me...


That one is old as the hills, no one uses it. There's better choices, like PureC or gcc.

"C" is not hard at all. Actually it has very few key words. Easy to remember them all.

If you have "dozen or so learn atari c books" why not open them and read?! There's an idea.
btw 'C-manship Complete' which is free, has a demo for each chapter with detailed explanations.

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is the best C compiler?

Postby Nyh » Mon Nov 03, 2008 4:18 pm

lp wrote:"C" is not hard at all. Actually it has very few key words. Easy to remember them all.

C is very hard. Especially for Charles.. The main reason for this is because it has a very few key words. It will take Charles about two years before he knows he has to call a function to print something. And Charles will be totally lost when he tries to print teh value of a long or a pointer. Speaking of pointers... can you imagine Charles using pointers?

No Charles, C is indeed very very hard. Stay away from it!

Hans Wessels

User avatar
thothy
Hatari Developer
Hatari Developer
Posts: 420
Joined: Fri Jul 25, 2003 9:36 am
Location: Germany
Contact:

Re: What is the best C compiler?

Postby thothy » Mon Nov 03, 2008 9:27 pm

charles wrote:too much {} for me and all new context.


If you do not like the { } braces, you should try LISP instead of C.

User avatar
Desty
Atari God
Atari God
Posts: 1951
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: What is the best C compiler?

Postby Desty » Mon Nov 03, 2008 9:33 pm

thothy wrote:If you do not like the { } braces, you should try LISP instead of C.

Not a bad idea; Lisp is a much, much nicer language to work with than C, and (on a modern machine and implementation like SBCL) quite fast - similar to the speed of Java. I've been working with it for a little while now and like it.

But let's not get Charles switching languages prematurely again :D
tá'n poc ar buile!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2265
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: What is the best C compiler?

Postby lp » Tue Nov 04, 2008 5:00 am

Nyh wrote:
lp wrote:"C" is not hard at all. Actually it has very few key words. Easy to remember them all.

C is very hard. Especially for Charles.. The main reason for this is because it has a very few key words. It will take Charles about two years before he knows he has to call a function to print something. And Charles will be totally lost when he tries to print teh value of a long or a pointer. Speaking of pointers... can you imagine Charles using pointers?

No Charles, C is indeed very very hard. Stay away from it!

Hans Wessels


lol

Yes, considering he says he don't know how a long is stored, you make a good point!
What the heck was I thinking. lol

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2323
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: What is the best C compiler?

Postby christos » Tue Nov 04, 2008 12:03 pm

LOL.
But I agree with Charles, writing code with line numbers is much more straight forward :D
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is the best C compiler?

Postby Nyh » Tue Nov 04, 2008 12:29 pm

christos wrote:LOL.
But I agree with Charles, writing code with line numbers is much more straight forward :D

Yes, nothing beats a nice calculated GOTO.

Hans Wessels

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Re: What is the best C compiler?

Postby PaulB » Tue Nov 04, 2008 1:48 pm

Nyh wrote:nothing beats a nice calculated GOTO.
Hans Wessels


Yuk! Image

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2323
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: What is the best C compiler?

Postby christos » Tue Nov 04, 2008 1:51 pm

Image
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests