UpScale: From Inherent Concurrency to Massive Parallelism through Type-based Optimizations