Last active
April 6, 2020 10:47
-
-
Save olafurpg/0cfa29af87c8a80a82a2281c456213c3 to your computer and use it in GitHub Desktop.
Revisions
-
olafurpg revised this gist
Apr 6, 2020 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,11 +7,15 @@ cs launch com.martiansoftware:nailgun-server:0.9.1 org.scala-lang:scala-compiler # Step 3: create basic Scala hello world echo 'println("Hello world!")' > Main.scala # Step 4: assemble the classpath. # You need at least the standard library, but you can add more libraries (for example JSON). CLASSPATH=$(cs fetch --classpath org.scala-lang:scala-library:2.13.1) # Step 5: evaluate the Scala hello world program with the nailgun server for i in {1..1000}; do time ng --nailgun-port 2113 scala.tools.nsc.MainGenericRunner -classpath $CLASSPATH -usejavacp Main.scala done # Once the nailgun process becomes hot, the compile+run feedback loop eventually becomes around ~200ms # > Hello world! # > real 0m0.199s -
olafurpg created this gist
Apr 6, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # Step 1: install coursier and nailgun brew install nailgun coursier/formulas/coursier # Step 2: start nailgun server with the Scala compiler on the classpath cs launch com.martiansoftware:nailgun-server:0.9.1 org.scala-lang:scala-compiler:2.13.1 --main com.martiansoftware.nailgun.NGServer -- 2113 & # Step 3: create basic Scala hello world echo 'println("Hello world!")' > Main.scala # Step 4: evaluate Scala program with nailgun server for i in {1..1000}; do time ng --nailgun-port 2113 scala.tools.nsc.MainGenericRunner -classpath $(cs fetch --classpath org.scala-lang:scala-library:2.13.1) -usejavacp Main.scala done # Once the nailgun process becomes hot, you should see that compile+run takes ~200ms on every run # > Hello world! # > real 0m0.199s