Which C Compiler?

Discuss all aspects of programming here. From 8-bit through to modern architectures.
Post Reply

Which C compiler do you use?

cc65 (Main project
1
10%
cc65 (dominicbeesley's BBC branch
1
10%
gcc (puppeh)
2
20%
gcc (Another one?)
0
No votes
Small C
1
10%
Beebug C on the BBC
3
30%
Acornsoft C on the BBC
1
10%
Something else? Let us know in the comments.
1
10%
 
Total votes: 10

User avatar
pau1ie
Posts: 668
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Which C Compiler?

Post by pau1ie » Wed Oct 24, 2018 10:58 am

In the cc65 thread dominicbeesley said he kind of gave up on cc65, though presumably people use it to make programs for 6502. If you use C, what compiler do you use most? I notice crtc uses puppeh's gcc variant for Sugar smash, possibly because puppeh is part of crtc, but presumably they find it is better than cc65 - maybe gcc being a more advanced compiler produces better code in the end? They use cl65 for linking, so presumably are aware of cc65 and have decided against using it?

Also let me know any tips and tricks you employ to help you, such as this workaround for cc65!

User avatar
Elminster
Posts: 3550
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: Which C Compiler?

Post by Elminster » Wed Oct 24, 2018 12:31 pm

Have them all, tried them all, but not regularly using any of them. I kind of stopped using them due to lack or libraries, running out of memory etc etc.

User avatar
mlouka
Posts: 62
Joined: Wed Sep 27, 2017 3:57 pm
Location: Halden, Norway
Contact:

Re: Which C Compiler?

Post by mlouka » Wed Oct 24, 2018 3:21 pm

I wrote a flappy bird clone in December/January using Beebug C to create a standalone executable. I had no problems with the compiler but I ended up using a little BASIC program to set up the display and slim font in order to use Mode 5 on a Beeb and Mode 1 (129) on a M128 as I ran out of memory on the Model B when linking with the standalone runtime library. I got the game working well enough to be playable but I used line drawing to for the sake of rapid prototyping. Had been meaning to try to incorporate Tricky's sprite routines (found elsewhere on this forum) but haven't had time since... What I liked about Beebug C (apart from being able to produce a standalone executable) is the header files with macros that made it easy to write readable code. For example, mapping draw(x,y) to the equivalent vdu-call for functions, like move, draw, colour, etc. and the same for common fx-calls That could easily be implemented for another compiler but I did not have the time/patience to try to set up a cc65 environment and wanted to try writing a game in C on a beeb in the Christmas break... Since Beebug C supports calling to assembler, I _think_ creating a little C library (or even just a header file with macros that assume that the sprite code is loaded into memory) to simplifying drawing sprites should be relatively easy and make writing little games in C really easy for those of us that write C much quicker than assembler. Unfortunately, I probably won't be able to find time to pick this up again before the Christmas break... I suspect that cc65 would be a better solution, unless it requires significantly more memory, although i found that Beebug C does work fine.
BBC Master 128, BBC Model B i7, Watford Electronics Solderless Sideways ROM board, PMS B2P-6502 2nd proc., PiTubeDirect (both internal and external), RetroClinic Multi-OS Selector, Sundby 256k RAM/ROM card, MMFS, Gotek, Music 500, ...

User avatar
Lardo Boffin
Posts: 1585
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Which C Compiler?

Post by Lardo Boffin » Wed Oct 24, 2018 3:38 pm

I have been trying to get to grips with Beebug C using my Model B with a co-processor. As detailed elsewhere this is somewhat hampered by a lack of a C based text editor.

@mlouka - does Beebug C produce reasonably fast programs. Or rather can it if you know what you are doing? :D
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
mlouka
Posts: 62
Joined: Wed Sep 27, 2017 3:57 pm
Location: Halden, Norway
Contact:

Re: Which C Compiler?

Post by mlouka » Thu Oct 25, 2018 4:41 pm

I haven't tried benchmarking to compare it with BASIC but it seems reasonably quick. My flappy bird clone is playable even though it looks a bit primitive as I only used lines to indicate where the bird and top/bottom of the columns are.

I used a modern text editor -- just made a little script to quickly insert the source file into an SSD to compile it in BeebEm. Compiling and linking on a real beeb is veeeery sloooow so I wouldn't recommend that. It is possible to code in Edit though on a BBC Master (and probably on a Model B with co-pro).
Attachments
flappy-owl-m128.ssd
(14.25 KiB) Downloaded 15 times
Last edited by mlouka on Thu Oct 25, 2018 5:57 pm, edited 2 times in total.
BBC Master 128, BBC Model B i7, Watford Electronics Solderless Sideways ROM board, PMS B2P-6502 2nd proc., PiTubeDirect (both internal and external), RetroClinic Multi-OS Selector, Sundby 256k RAM/ROM card, MMFS, Gotek, Music 500, ...

Coeus
Posts: 1271
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Which C Compiler?

Post by Coeus » Sat Oct 27, 2018 10:19 am

mlouka wrote:
Thu Oct 25, 2018 4:41 pm
I used a modern text editor -- just made a little script to quickly insert the source file into an SSD to compile it in BeebEm. Compiling and linking on a real beeb is veeeery sloooow so I wouldn't recommend that. It is possible to code in Edit though on a BBC Master (and probably on a Model B with co-pro).
For this kind of work, where you are preparing files with tools on the host and then running the result in an emulator, B-Em has VDFS which enables the BBC MOS to see files on the host directly. As of yesterday, it even has some documentation.

b2 has a neat feature whereby you can use HTTP to load code from the host directly into the emulator memory and start it running.

User avatar
Lardo Boffin
Posts: 1585
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Which C Compiler?

Post by Lardo Boffin » Tue Apr 09, 2019 8:59 am

I have recently been using the Norcroft C compiler on my Master running on the ARM emulated pi coproc.
I have been using Twin as a text editor.
Compiling a 1000 line file (including blank lines and comments etc.) takes about 20 seconds.
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

User avatar
fordp
Posts: 1016
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England
Contact:

Re: Which C Compiler?

Post by fordp » Tue Apr 09, 2019 12:39 pm

Does anybody have interesting open source projects for a 6502 based Acorn computer in C out there I would love to have a look?
Last edited by fordp on Tue Apr 09, 2019 12:39 pm, edited 1 time in total.
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

RobC
Posts: 2626
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Which C Compiler?

Post by RobC » Tue Apr 09, 2019 5:24 pm

fordp wrote:
Tue Apr 09, 2019 12:39 pm
Does anybody have interesting open source projects for a 6502 based Acorn computer in C out there I would love to have a look?
Frotz was mentioned a while back.

User avatar
mlouka
Posts: 62
Joined: Wed Sep 27, 2017 3:57 pm
Location: Halden, Norway
Contact:

Re: Which C Compiler?

Post by mlouka » Sun Apr 21, 2019 6:15 pm

Interesting. For a Pi-hosted solution then a good start would probably be to port ncurses/curses as that would make a lot of command-line tools and games easier to port.
RobC wrote:
Tue Apr 09, 2019 5:24 pm
fordp wrote:
Tue Apr 09, 2019 12:39 pm
Does anybody have interesting open source projects for a 6502 based Acorn computer in C out there I would love to have a look?
Frotz was mentioned a while back.
BBC Master 128, BBC Model B i7, Watford Electronics Solderless Sideways ROM board, PMS B2P-6502 2nd proc., PiTubeDirect (both internal and external), RetroClinic Multi-OS Selector, Sundby 256k RAM/ROM card, MMFS, Gotek, Music 500, ...

TimoHartong
Posts: 52
Joined: Fri Dec 30, 2016 10:02 pm
Location: The Netherlands
Contact:

Re: Which C Compiler?

Post by TimoHartong » Sun May 12, 2019 7:56 pm

It is a pitty that the C compilers for 32 bit machines are not included in the questionary.

User avatar
sydney
Posts: 2423
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

Re: Which C Compiler?

Post by sydney » Sun May 12, 2019 8:30 pm

You can make your own poll in a separate thread if you'd like.

Post Reply