title: How exactly does Scala leverage more cores as opposed to Java or other non-functional languages?
body: <p>I was listening to a Martin Odersky video recently where he attempts to explain the fundamental advantage of functional languages (such as Scala, but of course <em>not necessarily</em> Scala) over OOP or procedural languages.</p>
  
  <p>To paraphrase, he explains that <a href="https://en.wikipedia.org/wiki/Moore%27s_law" rel="noreferrer">Moore's Law</a> is failing us lately, and so to make processors "faster", instead of being able to double the number of transistors in the cores, CPU manufacturers are simply offering more cores. This in turn lends the CPU to being leveraged more fully by concurrent/multi-threaded applications. So that primary take away was: the more concurrent the application the more snippets of its code are running simultaneously on different cores, and with more cores on the CPU that overall faster the program executes.</p>
  
  <p>So far, so good.</p>
  
  <p>What he failed to explain (or more likely, what I failed to grasp) is <em>why</em> functional languages like Scala lend themselves to being more concurrent then other non-functional languages. Since we happen to be talking about the JVM space, let's do a quick comparison of Java and Scala. What is it about a Scala program that, if it were instead implemented in pure Java, would make it more difficult to parallelize/make concurrent, <strong>especially if its all compiling down to JVM bytecode and running on the same JVMs with the same native capabilities?</strong>?</p>
  
  <p>Meaning I have two JVM apps, App1 written in Java and App2 written in Scala. They both do the exact same tasks and accomplish the same things. Both get compiled down to JVM bytecode and are ran on the same computer with the same JVM installed on it. How is the Scala app able to "tap into" JVM capabilities that make it more suited for concurrency than the Java one (and thus, faster on a CPU with more cores on it)?</p>