Safe expression evaluator using the ast and compiler modules