Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is not C. #11

Open
EliteTK opened this issue Jun 7, 2016 · 5 comments
Open

This is not C. #11

EliteTK opened this issue Jun 7, 2016 · 5 comments

Comments

@EliteTK
Copy link

EliteTK commented Jun 7, 2016

A small problem with the description there. Arduino sketches are C++ and NOT C.

Not that it really matters, just thought I would point it out.

Edit: It seems like the language is actually based on a language called "Processing".

@JessieAMorris
Copy link

To be fair, it's a custom language based on C/C++.

@EliteTK
Copy link
Author

EliteTK commented Jun 7, 2016

Whatever it is, it certainly is not C and seems far closer to C++. (Apparently it's a language called "Processing"?)

Additionally, C is very dissimilar to C++, so much so that perfectly standards conformant C will often not compile under a C++ compiler, so I feel like grouping the languages together as "C/C++" is misleading to anyone learning C or C++.

@EliteTK EliteTK changed the title This is C++ not C. This is not C. Jun 7, 2016
@DanNixon
Copy link
Contributor

DanNixon commented Jun 8, 2016

The Arduino language is C++, specifically what is now known as "Arduino" is C++ with Wiring-like libraries (this provides stuff like digitalWrite, etc). This does not change the fact that it is C++.

Also the Processing language is Java, Java and C++ are very different languages. (Processing is an IDE which the Arduino IDE is based on, but with very different toolchains underneath)

@Potato-Matic
Copy link

Potato-Matic commented Aug 10, 2018

https://hackaday.com/2015/07/28/embed-with-elliot-there-is-no-arduino-language/

Thought I'd link this here, since it goes into great depth on how the libraries provided by Arduino and a couple of standard AVR libraries are combined with a regular C++ compiler and some pre-processing trickery to make what Arduino refer to as "The Arduino language."

They get into it a bit in the article, but it's entirely possible to preform the same steps with standard tools outside the Arduino IDE to get the same result and I think HaD wrote a tutorial/article specifically on this at some point. I've been meaning to set this up with a makefile myself, and there are other IDEs out there (like platformio) that re-implement the arduino IDE's toolchain. I migrated to platformio myself a while back after I started running into issues with how the trickery Arduino's preprocessor does to make things simpler started to conflict with standard preprocessor features I was trying to use.

EDIT: I think there's a good user-experience lesson to be learned here: There's no limit to the complexity of things you can teach to a beginner, so long as you wrap it up and give it a less scary name. :D

@Potato-Matic
Copy link

For anybody interested jumping in under the hood, I dug up the makefile article too:
https://hackaday.com/2015/10/01/arduino-development-theres-a-makefile-for-that/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants