There is one other thing I think should be added: If there are multiple .ino files in the sketch folder (shown as tabs in the IDE), concatenate them starting with the file that matches the sketch folder, followed by the rest in alphabetical order. Add the .cpp file extension to the resulting file.
That's it. It really isn't a huge difference. Now, there are a couple other things mentioned in that thread which might appear to some to be additional differences, but they're really not:
Arduino Language has its own data types and functions.
These are declared in Arduino.h so this is covered by the explanation of the preprocessor inserting the #include directive for that file. It's just a C++/C library, no magic. The "own data types" (byte, boolean, word) are just typedefs for C++ types.
necessity to "restrict" user to a init and loop function
@pnndra meant to say setup, not init. C++ programs must have a main() function but Arduino you don't need to have this function in .ino files, which might seem like a significant difference from C++. But this is not a difference at all. C++ allows multiple source files and Arduino's main() just happens to be defined in a separate file. That main() function calls setup and loop:
https://github.com/arduino/ArduinoCore-avr/blob/1.6.23/cores/arduino/main.cpp#L33-L51int main(void)
{
init();
initVariant();
#if defined(USBCON)
USBDevice.attach();
#endif
setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
return 0;
}
You could define setup() and loop() in a .cpp instead of a .ino file in the sketch if you like. So this is nothing specific to the Arduino programming language, it's just C++ being used exactly as it was intended to be used. You can define your own main() in the .ino file if you don't like the default main() so it's incorrect to say "restrict".
Anyway, if the founders think it is a new language then whatever we say will not change what they think. All we can advise is that an Arduino language sketch is very similar to a C++ program, and outline the differences.
I think that's a reasonable approach. I realized that I'm no expert in whether those three differences I mentioned are sufficient to claim a new programming language so I have no ground to argue. My interest is in making it as easy as possible for people to learn this programming language, whatever you want to call it. I've been giving a lot of thought about how that can be done. After some good discussion in another thread:
https://forum.arduino.cc/index.php?topic=620437I submitted an issue report to the repository that contains the Arduino Language Reference content:
https://github.com/arduino/reference-en/issues/623I'm hoping to get some input from some people at Arduino on that issue and then start improving the documentation in this respect.