Skip to content

Instantly share code, notes, and snippets.

View hrhino's full-sized avatar

Harrison Houghton hrhino

View GitHub Profile
@hrhino
hrhino / Debug.scala
Created November 4, 2019 21:49
commands for enabling / disabling java debugger in scala/scala
package scala.build
import sbt._, Keys._, plugins._
object Debug extends AutoPlugin {
override def requires = JvmPlugin
override def trigger = allRequirements
import VersionUtil._
@hrhino
hrhino / results
Last active August 25, 2018 02:35
(all results are from quick builds using 2.12.5 as starr, optimisations enabled)
# v2.12.6
[info] Result "scala.tools.nsc.HotScalacBenchmark.compile":
[info] N = 494
[info] mean = 960.969 ±(99.9%) 4.224 ms/op
[info] Histogram, ms/op:
[info] [ 900.000, 925.000) = 29
[info] [ 925.000, 950.000) = 162
[info] [ 950.000, 975.000) = 182
[info] Result "scala.tools.nsc.HotScalacBenchmark.compile":
[info] N = 450
[info] mean = 1089.191 ±(99.9%) 2.524 ms/op
[info] Histogram, ms/op:
[info] [1000.000, 1012.500) = 0
[info] [1012.500, 1025.000) = 0
[info] [1025.000, 1037.500) = 0
[info] [1037.500, 1050.000) = 1
[info] [1050.000, 1062.500) = 15
[info] [1062.500, 1075.000) = 69
hhoughton-de@ import $ivy.`com.chuusai::shapeless:2.3.2`; import shapeless._
import $ivy.$ ;
import shapeless._
hhoughton-de@ import shapeless._
import shapeless._
hhoughton-de@ import shapeless.ops.hlist._
import shapeless.ops.hlist._
hhoughton-de@ import shapeless.ops.record._
import shapeless.ops.record._
hhoughton-de@
@hrhino
hrhino / c.eval()
Created August 20, 2017 20:03
illTyped vs c.eval
scala> def snc_impl(c: blackbox.Context)(s: c.Expr[String]): c.Tree = {
| import c.universe._
| val Literal(Constant(code:String)) = s.tree; val wrapped = q""" { lazy val ignore = { ${c.parse(code)} }; () } """
| val err = try { c.eval(c.Expr[Unit](wrapped)); None } catch { case e: Throwable => Some(e) }
| err match {
| case Some(e) => c.info(NoPosition, e.getMessage, true); q"()"
| case None => c.abort(NoPosition, "unexpected success")
| }
| }
snc_impl: (c: scala.reflect.macros.blackbox.Context)(s: c.Expr[String])c.Tree
> test:console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.
scala> <console>:1: error: identifier expected but $XMLSTART$< found.
import <none>._
^
<console>:12: error: not found: value intp
diff --git a/compiler.properties b/compiler.properties
index be20f3c..03b9dbc 100644
--- a/compiler.properties
+++ b/compiler.properties
@@ -1,4 +1,4 @@
-#Wed Jun 14 20:44:41 EDT 2017
+#Wed Jun 14 20:47:22 EDT 2017
copyright.string=Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.
version.number=2.12.2-20170614-184613-c26a1c6
osgi.version.number=2.12.2.v20170614-184613-c26a1c6