pub fn encode_program(program: &Program) -> Result<Vec<u8>, String>
Encodes a program after validating it. Constants use the portable HTA value codec; unsupported runtime-only values are rejected explicitly.