compiler: share value_to_ast
compiler: fold constants