ProgramBench: Can Language Models Rebuild Programs from Scratch?