scala porting