There have always been some games which focus on the player doing some programming but I've only seen this done AS the game e.g. write a bot AI for a bot fighting game.
My interest is mainly in RTS games and particularly in giving the player a higher-level position in controlling their base and armies instead of individual units. One interesting idea (to me) is having a hierarchical AI system... each unit has its own AI, each unit is in a squadron which has squadron-level AI, squadrons group into larger groups led by a General who has it's own AI, etc... similarly your base has AI controlling how to prioritise resource harvesting, unit creation, which buildings to power/protect in case of shortages.
Being able to upgrade these AIs as part of the game could make a big difference rather than just having bigger guns. But then one thought I had was letting the player actually write their own AI code. Designing how your Generals will function to complement your tactics, and so on.
Many games use scripting (Lua, etc) for AI which means in theory you can already do this if a game exposes those scripts. But what do people think about this actually being a deliberate part of the game?
Both in RTS and other games, how does the idea of part of the game being about programming grab you? Is this so niche that it's commercial suicide and could only happen as an open-source/hobby project?