I have an Arduino Uno. It doesn't have a lot of memory space, which is a bit of a nuisance. I was wondering: Is it possible to load a text file from an SD card and compile it on the Arduino into code that the Arduino can use. I don't really care if it is slow or uses 99% of the memory space just to load on the code. If it is possible would this work: use bootup code to load a piece of code to Arduino, dispose of bootup code so there is more code, do what ever that code does, dispose of that code, load new code.
See topic #16812, “Load sketch code from SD Card”, in forum.arduino.cc, which explains how to replace the ordinary Arduino bootloader with one that can load programs from an SD card.
Note, the program code that these loaders install into flash is already compiled, as opposed to being original C source code. If you want to load source-level code into the Arduino, look for an interpreter / interpretive language to run on the Arduino.
The flash memory is only designed to be reloaded 10,000 times. While that might seem a lot, if you are planning a system where, every day you load some part of code into flash, and then some other part, etc. you will use up those 10,000 writes fairly quickly.
I don't really care if it is slow or uses 99% of the memory space just to load on the code.
Well, you will care because if 99% of the memory space is the loader, you will only have 1% for the code, which defeats the purpose.
It doesn't have a lot of memory space, which is a bit of a nuisance.
I suggest a larger processor such as the Atmega1284 (128k of flash), Atmega2560 (256k of flash) or the Atmega644P (64k of flash).
All but the Atmega2560 come in DIP versions of the chips, if that helps.