arxiv Prompts As Programs: A Structure-Aware Approach to Efficient Compile-Time Prompt Optimization