Welcome, Guest. Please login or register.

Author Topic: C++ on Amiga  (Read 14937 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline NovaCoder

Re: C++ on Amiga
« on: August 31, 2009, 12:39:51 AM »
Yep I think the idea that C++ is slower is not accurate these days, it's similar to the idea the C is slower than assembler (modern compilers produce very efficient assembler).

Anyway I've been using C++ on my 1200 for a port of DOTT.

I use StormC V4 which uses the GCC compiler and features an IDE with built in debugger which makes everything a lot easier.  You can still buy StromC V4 new for about $50.

It will take you longer to learn C++ of course, I spent a year learning straight C before I started looking at C++.
Life begins at 100 MIPS!


Nice Ports on AmiNet!
 

Offline NovaCoder

Re: C++ on Amiga
« Reply #1 on: August 31, 2009, 07:23:02 AM »
Quote from: matthey;521559
C IS slower than assembler. GCC's code optimization is a joke. Why is ffmpeg for the 68060 twice as fast with a few assembler routines compared to all C routines? I don't know much about C++ compared to C but I have seen too much assembly output from C programs to believe C is as fast as assembler. Plus I can beat it 95% of the time with assembler.



Well obviously over the years C/C++ compilers have improved massively and these days you'll improve performance more from looking at what the code is doing from a high-level rather than trying to hand-optimize algorithms (the quickest code is code you don't actually execute).  

I remember reading an assembler 'tuning' article which had an exercise to improve some compiler generated assembler by-hand.  When I went to make the change myself, I found that my newer version of the compiler had already produced exactly the same assembler as the article suggested ;)

I wasn't talking specifically about GCC, I was talking about modern compilers C++ in general.
« Last Edit: September 01, 2009, 12:40:31 AM by NovaCoder »
Life begins at 100 MIPS!


Nice Ports on AmiNet!
 

Offline NovaCoder

Re: C++ on Amiga
« Reply #2 on: September 01, 2009, 12:44:18 AM »
Quote from: amigadave;521620
Some books, or articles have suggested that learning C first before learning C++ may actually slow down the learning process and that learning C first is not necessary, or really desirable.  Is that accurate in your opinion, or do you think that it helped you by learning C first then moving on to C++?


Yep I think it helped me to learn C first (although it was a bit boring).  It's quite a big brain-space jump to think about proper object orientation and you don't want the extra strain of learning the language syntax.

I'd only used Basic before getting into C/C++ so it was a steep learning curve for me :)
« Last Edit: September 01, 2009, 05:14:51 AM by NovaCoder »
Life begins at 100 MIPS!


Nice Ports on AmiNet!
 

Offline NovaCoder

Re: C++ on Amiga
« Reply #3 on: December 06, 2012, 11:24:22 PM »
Quote from: andst;717821
Hey, a C++ thread waking up  :-)   (any zombie thread rules on this forum?)

Are people doing C++ coding on Amiga these days?

//A.

I don't do any C++ coding on my Amiga (too painfully slow), I still use gcc (cross compiler) on my PC.

Any 'modern' Amiga 68k targeted C/C++ development is very hard to do, the tools are just not up to the job.   I once spent weeks trying to debug a nasty memory related issue while porting ScummVM to 68k, this issue only seems to effect the 68k version of gcc and in any case, if I'd had a debugger I could have fixed the problem in about 5 seconds flat.
« Last Edit: December 06, 2012, 11:26:49 PM by NovaCoder »
Life begins at 100 MIPS!


Nice Ports on AmiNet!
 

Offline NovaCoder

Re: C++ on Amiga
« Reply #4 on: December 07, 2012, 12:41:11 AM »
Quote from: EDanaII;717876
@ andst

I've tried many of them, from SasC, to Storm and Cubic on the Amiga. SasC and Storm come with debuggers, but I've only had luck with the Storm one. Like NovaCoder, I've had the most success using a GCC in conjunction with Eclipse, but, sadly, no debugger for it, although it may be possible to set up a remote debugger. I'm still figuring that one out.


@ NovaCoder

It may be possible to do remote debugging with Eclipse. I'm currently researching how it might be done. The tools appear to be there, so I'm just not certain how to set them up or if they will play well together yet.

I've opened up a query over on the new meant-to-be-a-Utilitybase-replacement forum. Anybody who has any ideas is welcome to comment either here or there on the subject.

Hiya,

Yep I did manage to get Eclipse CDT 'working' using the AmiDevCpp cross compiler setup.  It managed to compile some of my project then started giving me errors about missing includes that were actually there.  I've now gone back to AmiDevCpp which may not have as many features as Eclipse CDT but at least it works.   I also tried CubicIDE and got nowhere, pain in the bottom.

I think it may be possible to hack in the gcc debugger to work from the shell but I doubt you'd be able to integrate it to CDT.

Trying to do any large scale C/C++ development without a debugger is like trying to fly a plane at night......with your eyes shut ;)
Life begins at 100 MIPS!


Nice Ports on AmiNet!