in fact, you have three general ways to use this module.
1) compile native software, including everything and load it in. What it will do is defined in time of compilation. Many examples are available around of this.
2) use firmware with any interface for other uController, like AT commands. Then, your module will be almost "stupid" without any other uC controlling it, so you wil have to program something else and connect them together - like arduino
3) use any higher interface, with ability to store commands to be done after restart, like Lua. Then, you can once upload Lua firmware, then play around quickly with serial port on PC like with AT commands, but you can also store your program for later execution.
AT commands are very simply, and the ESP acts only as slave to other inteligence.
Lua interpretter is much much more powerfull and can make the ESP work alone - but also it can be used in cooperation with other uC.
Native firmware gives you available all the functionality of ESP, but it requires more programming practise and many many uploadings of firmware. Then, it can do anything ( e.g. AT commands or Lua interpretter )
Also promising looks project with direct upload of arduino sketches ( like native firmware )