Some OpenSource/DIY software projects, containing legacy C code have been rewritten into C++. There is no any reasons to stay on C if C++ available on target platform. It has everything that C has and many "free" features, which cost 0 extra bytes and 0 extra instructions.
But I think Terminal-BASIC must go through a reverse transformation. I'm rewriting core components in pure C.
The 8-bit AVR microcontrollers were primary target at the project starting point. G++ supports this architecture, as well as 32-bit ARM versions of Arduino DUE, etc.
But many interesting architextures do not support C++. I think about running Terminal-BASIC on Z80 with SDCC, PIC uCs and... SEGA Genesis consoles (MC68000 has G++ port, but the popular SDK SGEN does not support C++).
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
>It has everything that C has and many "free" features, which cost 0 extra bytes and 0 extra instructions.
Not quite. Some features of C++, such as constructors and destructors, in particular for static objects, require extra runtime code to support. But if you were to do something equivalent in C, it might come out to be the same. It might not matter, since modern processors have a lot of code space. The older ones are more constrained.
Are you sure? yes | no
You are right, but I mean a truly free language elements: namespaces, functions and operators overloading, strict type conversions, templates and deduced types.
These can't make the code more compact or fast, but make it more robust, readable and cross-platform.
Are you sure? yes | no
Sure, after all the first C++ compiler targetted C code. I feel old.
Are you sure? yes | no