I am currently using the stand-alone Arduino IDE to code for an UNO.
Whilst not a fan of C being a physicist Fortran fanboy I do think the Arduino IDE is a very nice piece of code that makes my newbie life much easier - Brownie points to the coders, thank you!
However ... for a general user is there any merit in using a 3rd party compiler, possibly at the end of development. I believe that gcc can cross-compile for Arduinos. If one ramps up the optimisation level is the resultant code significantly faster/smaller.
More curious than anything else but just wondered if this was a common thing to do.
Read this 10 times to try to understand what you're asking... do you want to compile Arduino sketches and libraries, outside of the Arduino IDE environment? Or invoke a different compiler from within the IDE? Or move to a completely different development environment that supports the more standard C/C++ system of .h .cpp files and makefiles etc?
thanks for that. I didn't realise that the IDE used gcc
My question appears to have been rather poorly phrased. I was wondering whether there is any merit, for a general user in trying to increase compiler optimisation levels or whether they are already high enough.
By default, code is optimized for size (-Os). See platform.txt.
In some scenarios, -O3 might lead to better performance, but it can also significantly increase memory usage. Given that there's only 32 KiB of flash memory on an UNO, this could be an issue, so -Os is a sensible default.
You can add your own menu options to select the optimization level, that's what Teensy does, for example. (I can't seem to find their boards.txt/platform.txt on GitHub right now, but you can download them from the Teensyduino web page if you're interested how they approach the different optimization levels.)
ianRobinson101:
My question appears to have been rather poorly phrased.
i think PieterP is addressing your point about optimization
you're certainly not the only one confused. i've heard arguments that Arduino doesn't use C/C++ because those languages don't have a "byte" variable type. but they are simply typedefs in Arduino.h
ianRobinson101:
My question appears to have been rather poorly phrased.
It certainly is, but the answer is almost certainly - no. You might ask the question again when you are no longer a general user, and find the standard IDE intolerable.