PHP to Scala, Scala to JavaScript