C++

Anything QL Software or Programming Related.
User avatar
Whopper
Over Heated PSU
Posts: 126
Joined: Tue Oct 24, 2017 4:04 pm

C++

Post by Whopper »

Hi All,

Stupid question time again.

Is there a C++ compiler for the QL?

Whopper.


You woke me for THAT!!!
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: C++

Post 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


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Whopper
Over Heated PSU
Posts: 126
Joined: Tue Oct 24, 2017 4:04 pm

Re: C++

Post 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


You woke me for THAT!!!
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: C++

Post 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.
Last edited by Derek_Stewart on Tue Mar 12, 2024 4:34 pm, edited 1 time in total.


Regards,

Derek
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: C++

Post 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.


User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: C++

Post 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


May the FORTH be with you !
POLKa
User avatar
Whopper
Over Heated PSU
Posts: 126
Joined: Tue Oct 24, 2017 4:04 pm

Re: C++

Post 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.


You woke me for THAT!!!
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: C++

Post 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.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: C++

Post 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 :!: )


Per
dont be happy. worry
- ?
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: C++

Post 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.


Regards,

Derek
Post Reply