understanding under the hood

I have tinkered with a few simple projects and feel somewhat competent at my arduino now. However I long to know more about what is happening behind the scenes. For example, the "sketch" or source I run looks a lot like C.

But is actually shipped thru a C compiler with some specific options then executed on board? Or is this more of a C-like language that is specific to the arduino IDE, that is translated to something arduino-specific?

If I have a different device with an ATmega328, how close is my code to running on board there?

I have long heard that devices like launchpad, MSP430, galileo are more difficult to operate with. Is that because the arduino tools are holding my hand and taking care of a bunch of hard details under the hood, or is that because these other products are simply not as polished for a user/dev like me?

Thanks a ton for any explanation that adds to my understanding!

blah44:
I have tinkered with a few simple projects and feel somewhat competent at my arduino now. However I long to know more about what is happening behind the scenes. For example, the "sketch" or source I run looks a lot like C.

It is in fact C++ and is handled by the gcc compiler provided in the IDE distribution.

But is actually shipped thru a C compiler with some specific options then executed on board? Or is this more of a C-like language that is specific to the arduino IDE, that is translated to something arduino-specific?

If I have a different device with an ATmega328, how close is my code to running on board there?

I have long heard that devices like launchpad, MSP430, galileo are more difficult to operate with. Is that because the arduino tools are holding my hand and taking care of a bunch of hard details under the hood, or is that because these other products are simply not as polished for a user/dev like me?

No, it's mostly because the Arduino distribution also supplies many library functions, like digitalRead() for example. These 'value added functions' are specific for the arduino but they are written in C++ and the source code for all are also in the IDE distribution.

Thanks a ton for any explanation that adds to my understanding!

Great; thanks again!

Could anyone comment on running this code (source or binary form) on another ATmega328 device, or tell me about some MSP430 direct experience?

blah44:
Could anyone comment on running this code (source or binary form) on another ATmega328 device

Well I think you mean "ATmega" device, since 328 is a specific device. The IDE natively supports the 32u4, 2560, 1280, SAM3X from AVR. The ATtinys and others are supported with some plugins/extensions.

blah44:
or tell me about some MSP430 direct experience?

The Energia project is an attempt to provide an Arduino-like environment (cross-platform with pre-made library) for the 430.

This document is a bit out of date, but helps to explain what's going on "Under the hood".

http://arduino.cc/en/Hacking/BuildProcess

As well as this older breakdown by westfw when compiling an empty sketch:
http://forum.arduino.cc/index.php/topic,5680.0.html