What is the 8-bit simulator in scala compiler and how to launch it?

霸气de小男生 提交于 2019-12-10 14:59:14

问题


I was reading this question and saw:

scalac includes an 8-bit simulator of a fully armed and operational battle station, viewable using the magic key combination CTRL-ALT-F12 during the GenICode compilation phase.

To show what compilation phases scalac has, I used scalac -Xshow-phases.

phase name  id  description
----------  --  -----------
<  ...  >
     icode  23  generate portable intermediate code

Seems to be the relevant phase.

I compile a Hello-world program

object Hello {
  def main(args: Array[String]): Unit = {
    println("Hello, world!")
  }
}

by scalac Hello.scala and pressed CTRL-ALT-F12 all the way. Nothing happened. And tried scalac -Xprint:icode Hello.scala with CTRL-ALT-F12, nothing special as well.

How can I trigger the simulator? And what does that do?

On scala 2.11.8 and OS X 10.11.5

来源:https://stackoverflow.com/questions/37873589/what-is-the-8-bit-simulator-in-scala-compiler-and-how-to-launch-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!