Page 1 of 3
C++
Posted: Wed Jan 30, 2019 7:17 pm
by Whopper
Hi All,
Stupid question time again.
Is there a C++ compiler for the QL?
Whopper.
Re: C++
Posted: Wed Jan 30, 2019 7:48 pm
by tofro
Simple answer: No.
Maybe the best bet would be to try and adapt the gcc 2.95 patches to a (more) modern gcc (a challenge in itself) and extend them to g++ (another significant challenge). 68k support in recent gcc/g++ has become worse and worse due to lack of interest and maintainers.
Tobias
Re: C++
Posted: Thu Jan 31, 2019 5:12 pm
by Whopper
Tobias,
Thanks for this. I thought that this would be the case, but it would have made a project much easier with C+. Still never mind I suppose assembler will bo.
Whopper
Re: C++
Posted: Mon Feb 11, 2019 9:09 pm
by Derek_Stewart
Hi,
I have always wanted a C++ compiler on the QL.
C++ was developed from C into C++ precursor called C wth Classes, I was reaserching how this process was done, with view to update C68, to C68 with Classes.
But C68 is an old ANSI C compiler, so maybe C68 wants to updated to the latest ANSI C Standard.
Re: C++
Posted: Tue Feb 12, 2019 6:50 am
by stevepoole
Hi,
Do we really need classes ? I use C++, but get by without them !
C++ is better than C, but mainly as it cures some C problems, such as poor input and output operators.
And as it is not an interpreted language, bug-finding can be pretty horrendous.
Why use C++ at all ? The simple answer is that it is blisteringly fast on a PC.... ( hundreds of times faster than SMSQ/E on QPC2 )
But how would it perform on a 68000-based motherboard ?
Regards,
Steve Poole.
Re: C++
Posted: Tue Feb 12, 2019 12:11 pm
by polka
Hi, I agree !
Starting to program with Fortran 2 then Fortran 4 and Fortran 77, and also with several Basic dialects, when in the meantime I discovered C (and Forth), I found that I had the right powerful tools - and even before C++, on the machines that I used professionnaly (that were all more or less non-standard), I saw the (plain) C compilers get faster all the time. Then I rather jumped over C++ to adopt Ada (on big real time projects) and then Jbed, a true object oriented Java (sporting not "priorities" but "earliest deadline first" - the best way to manage a huge number of objects within a real time application).
But for my eighties old QLs, a C68 compiler will still do, IMO.
Polka
Re: C++
Posted: Tue Feb 12, 2019 6:31 pm
by Whopper
Hi All,
I was wanting to use C++ classes for multiple LCD screens. That is just so much easier with C++. Using assembler (or C) I have to maintain two, or more, separate drivers for the screens. It can be done, just more messy and harder to maintain than with classes.
Whopper.
Re: C++
Posted: Tue Feb 12, 2019 10:19 pm
by NormanDunbar
Seem to remember that classes are "just" structs with a fancy name. I would imagine there is probably a way ti use structs in a classy sort of way with C68?
Anyway, don't let Tony Tebby hear you mention classes or objects as I seem to remember him slagging them off big time in an article in QL Today.
Cheers,
Norm.
Re: C++
Posted: Tue Feb 12, 2019 11:26 pm
by pjw
NormanDunbar wrote:Anyway, don't let Tony Tebby hear you mention classes or objects as I seem to remember him slagging them off big time in an article in QL Today.
Wasnt that Linus Torvalds? I know he was pretty abusive about c++. Thought the best thing about it was that it'd keep crappy programmers away from C!
(Not my words
)
Re: C++
Posted: Wed Feb 13, 2019 8:28 am
by Derek_Stewart
Hi,
Reading all the comments, there seems to a consensus, that C++ is not a good idea.
But how about trying to bring C68 upto the current ANSI C standard, C11 standard is called ISO/IEC 9899:2011.