Scala implementation of JVSTM