comile rust file and add loop sample