If a program could program itself?.... (AI)

Virtually any (interpreted) script language can reprogram itself in a sense. For example VB with its "Execute" function lets you execute an arbitrary string. So it could generate code and then execute it. Ditto for Lua.