create a scala generator