There is no magic to compiling and uploading Arduino programs. To address an earlier question there is no such thing as "Arduino programming language", it is just C/C++ code compiled with the GNU tool chain.
Here is a simple batch file I used to compile the libraries and the main() stub:
set ARD_BIN=C:\arduino-0021\hardware\tools\avr\bin
set ARD_INC=C:\arduino-0021\hardware\arduino\cores\arduino
%ARD_BIN%\avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=21 -I%ARD_INC% *.c
%ARD_BIN%\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=21 -I%ARD_INC% *.cpp
%ARD_BIN%\avr-ar rcs core.a *.o
... and here's a simple file I use to compile and upload the current project:
set ARD_BIN=C:\arduino-0021\hardware\tools\avr\bin
set ARD_INC=C:\arduino-0021\hardware\arduino\cores\arduino
%ARD_BIN%\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=21 -I%ARD_INC% *.cpp
%ARD_BIN%\avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p *.o -I%ARD_INC% %ARD_INC%*.a -lm
%ARD_BIN%\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 a.out a.eep
%ARD_BIN%\avr-objcopy -O ihex -R .eeprom a.out a.hex
%ARD_BIN%\avrdude -CC:\arduino-0021\hardware/tools/avr/etc/avrdude.conf -patmega328p -q -cstk500v1 -P\.\COM25 -b115200 -D -Uflash:w:a.hex:i
Neither file is a shining example of scripting, in fact, I think the second file could completely eliminate the gcc execution if I played with the switches on the g++ command line.
Set up files like this and you can use ANY editor.
The only thing for which I use the IDE is to run the serial monitor. If it was a separate program I wouldn't need the IDE at all.
Don't know why the developers waste their time on this poor piece of work.