scala-native / scala-native Goto Github PK
View Code? Open in Web Editor NEWYour favorite language gets closer to bare metal.
Home Page: http://scala-native.org
License: Other
Your favorite language gets closer to bare metal.
Home Page: http://scala-native.org
License: Other
Cool project!
Build fails as below. Mac OS X El Capitan. Current master (06739d6).
Any ideas?
Thanks,
Bryn
bkeller@bkeller-mac01 ~/src/scala-native [11:59:01]
> $ sbt package [±master ●]
[info] Loading global plugins from /Users/bkeller/.sbt/0.13/plugins
[info] Loading project definition from /Users/bkeller/src/scala-native/project
[info] Compiling 61 Scala sources to /Users/bkeller/src/scala-native/project/target/scala-2.10/sbt-0.13/classes...
[error] uncaught exception during compilation: java.lang.AssertionError
java.lang.AssertionError: assertion failed:
while compiling: /Users/bkeller/src/scala-native/util/src/main/scala/scala/scalanative/util/package.scala
during phase: jvm
library version: version 2.10.6
compiler version: version 2.10.6
reconstructed args: -classpath /Users/bkeller/src/scala-native/project/target/scala-2.10/sbt-0.13/classes:/Users/bkeller/.sbt/0.13/plugins/target/scala-2.10/sbt-0.13/classes:/Users/bkeller/.ivy2/cache/scala_2.10/sbt_0.13/org.ensime/ensime-sbt/jars/ensime-sbt-0.3.2.jar:/Users/bkeller/.ivy2/cache/org.scala-lang/scalap/jars/scalap-2.10.6.jar:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-compiler.jar:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-reflect.jar:/Users/bkeller/.ivy2/cache/org.scalariform/scalariform_2.10/jars/scalariform_2.10-0.1.4.jar:/Users/bkeller/.ivy2/cache/commons-io/commons-io/jars/commons-io-2.4.jar:/Users/bkeller/.ivy2/cache/scala_2.10/sbt_0.13/com.geirsson/sbt-scalafmt/jars/sbt-scalafmt-0.2.3.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/sbt/jars/sbt-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/main/jars/main-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/actions/jars/actions-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/classpath/jars/classpath-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/interface/jars/interface-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/io/jars/io-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/control/jars/control-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/launcher-interface/jars/launcher-interface-1.0.0-M1.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/completion/jars/completion-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/collections/jars/collections-0.13.11.jar:/Users/bkeller/.ivy2/cache/jline/jline/jars/jline-2.13.jar:/Users/bkeller/.ivy2/cache/org.fusesource.jansi/jansi/jars/jansi-1.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/api/jars/api-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/classfile/jars/classfile-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/logging/jars/logging-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/process/jars/process-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-integration/jars/compiler-integration-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/incremental-compiler/jars/incremental-compiler-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/relation/jars/relation-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compile/jars/compile-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/persist/jars/persist-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-tools.sbinary/sbinary_2.10/jars/sbinary_2.10-0.4.2.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-ivy-integration/jars/compiler-ivy-integration-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/ivy/jars/ivy-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/cross/jars/cross-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt.ivy/ivy/jars/ivy-2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a.jar:/Users/bkeller/.ivy2/cache/com.jcraft/jsch/jars/jsch-0.1.46.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/serialization_2.10/jars/serialization_2.10-0.1.2.jar:/Users/bkeller/.ivy2/cache/org.scala-lang.modules/scala-pickling_2.10/jars/scala-pickling_2.10-0.10.1.jar:/Users/bkeller/.ivy2/cache/org.scalamacros/quasiquotes_2.10/jars/quasiquotes_2.10-2.0.1.jar:/Users/bkeller/.ivy2/cache/org.json4s/json4s-core_2.10/jars/json4s-core_2.10-3.2.10.jar:/Users/bkeller/.ivy2/cache/org.json4s/json4s-ast_2.10/jars/json4s-ast_2.10-3.2.10.jar:/Users/bkeller/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.6.jar:/Users/bkeller/.ivy2/cache/org.spire-math/jawn-parser_2.10/jars/jawn-parser_2.10-0.6.0.jar:/Users/bkeller/.ivy2/cache/org.spire-math/json4s-support_2.10/jars/json4s-support_2.10-0.6.0.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/run/jars/run-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/task-system/jars/task-system-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/tasks/jars/tasks-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/tracking/jars/tracking-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/cache/jars/cache-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/testing/jars/testing-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/test-agent/jars/test-agent-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/apply-macro/jars/apply-macro-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/command/jars/command-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/logic/jars/logic-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-interface/jars/compiler-interface-0.13.11.jar -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/classes:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-library.jar
last tree to typer: Literal(Constant(scalanative.nir.Dep.Dep$Conditional))
symbol: null
symbol definition: null
tpe: Class(classOf[scala.scalanative.nir.Dep$Conditional])
symbol owners:
context owners: class package$UnsupportedException -> package util
== Enclosing template or block ==
Template( // val <local UnsupportedException>: <notype> in class package$UnsupportedException, tree.tpe=scalanative.util.package$UnsupportedException
"java.lang.Exception", "scala.Product", "scala.Serializable" // parents
ValDef(
private
"_"
<tpt>
<empty>
)
// 12 statements
ValDef( // private[this] val msg: String in class package$UnsupportedException
private <local> <caseaccessor> <paramaccessor> <triedcooking>
"msg "
<tpt> // tree.tpe=String
<empty>
)
DefDef( // val msg(): String in class package$UnsupportedException
<method> <stable> <caseaccessor> <accessor> <paramaccessor> <triedcooking>
"msg"
[]
List(Nil)
<tpt> // tree.tpe=String
package$UnsupportedException.this."msg " // private[this] val msg: String in class package$UnsupportedException, tree.tpe=String
)
DefDef( // def copy(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException
<method> <synthetic>
"copy"
[]
// 1 parameter list
ValDef( // msg: String
<param> <defaultparam/trait> <triedcooking>
"msg"
<tpt> // tree.tpe=String
<empty>
)
<tpt> // tree.tpe=scalanative.util.package$UnsupportedException
Apply( // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException, tree.tpe=scalanative.util.package$UnsupportedException
new scalanative.util.package$UnsupportedException."<init>" // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException, tree.tpe=(msg: String)scalanative.util.package$UnsupportedException
"msg" // msg: String, tree.tpe=String
)
)
DefDef( // def copy$default$1(): String in class package$UnsupportedException
<method> <synthetic> <defaultparam/trait>
"copy$default$1"
[]
List(Nil)
<tpt> // tree.tpe=String
Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
package$UnsupportedException.this."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
Nil
)
)
DefDef( // override def productPrefix(): String in class package$UnsupportedException
<method> override <synthetic>
"productPrefix"
[]
List(Nil)
<tpt> // tree.tpe=String
"UnsupportedException"
)
DefDef( // def productArity(): Int in class package$UnsupportedException
<method> <synthetic>
"productArity"
[]
List(Nil)
<tpt> // tree.tpe=Int
1
)
DefDef( // def productElement(x$1: Int): Object in class package$UnsupportedException
<method> <synthetic>
"productElement"
[]
// 1 parameter list
ValDef( // x$1: Int
<param> <synthetic> <triedcooking>
"x$1"
<tpt> // tree.tpe=Int
<empty>
)
<tpt> // tree.tpe=Object
Block( // tree.tpe=Object
ValDef( // case val x1: Int
case <synthetic> <triedcooking>
"x1"
<tpt> // tree.tpe=Int
"x$1" // x$1: Int, tree.tpe=Int
)
Match( // tree.tpe=Object
Typed( // tree.tpe=Int
"x1" // case val x1: Int, tree.tpe=Int
<tpt> // tree.tpe=Int
)
// 2 cases
CaseDef( // tree.tpe=String
0
Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
package$UnsupportedException.this."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
Nil
)
)
CaseDef( // tree.tpe=Nothing
"_" // tree.tpe=Int
Throw( // tree.tpe=Nothing
Apply( // def <init>(x$1: String): IndexOutOfBoundsException in class IndexOutOfBoundsException, tree.tpe=IndexOutOfBoundsException
new IndexOutOfBoundsException."<init>" // def <init>(x$1: String): IndexOutOfBoundsException in class IndexOutOfBoundsException, tree.tpe=(x$1: String)IndexOutOfBoundsException
Apply( // def toString(): String in class Object, tree.tpe=String
scala.Int.box(x$1)."toString" // def toString(): String in class Object, tree.tpe=()String
Nil
)
)
)
)
)
)
)
DefDef( // override def productIterator(): Iterator in class package$UnsupportedException
<method> override <synthetic>
"productIterator"
[]
List(Nil)
<tpt> // tree.tpe=Iterator
Apply( // def typedProductIterator(x: Product): Iterator in object ScalaRunTime, tree.tpe=Iterator
runtime.this."ScalaRunTime"."typedProductIterator" // def typedProductIterator(x: Product): Iterator in object ScalaRunTime, tree.tpe=(x: Product)Iterator
This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
)
)
DefDef( // def canEqual(x$1: Object): Boolean in class package$UnsupportedException
<method> <synthetic>
"canEqual"
[]
// 1 parameter list
ValDef( // x$1: Object
<param> <synthetic> <triedcooking>
"x$1"
<tpt> // tree.tpe=Object
<empty>
)
<tpt> // tree.tpe=Boolean
Apply( // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=Boolean
TypeApply( // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=()Boolean
"x$1"."$isInstanceOf" // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=[T0 >: ? <: ?]()Boolean
<tpt> // tree.tpe=scalanative.util.package$UnsupportedException
)
Nil
)
)
DefDef( // override def hashCode(): Int in class package$UnsupportedException
<method> override <synthetic>
"hashCode"
[]
List(Nil)
<tpt> // tree.tpe=Int
Apply( // def _hashCode(x: Product): Int in object ScalaRunTime, tree.tpe=Int
ScalaRunTime.this."_hashCode" // def _hashCode(x: Product): Int in object ScalaRunTime, tree.tpe=(x: Product)Int
This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
)
)
DefDef( // override def equals(x$1: Object): Boolean in class package$UnsupportedException
<method> override <synthetic>
"equals"
[]
// 1 parameter list
ValDef( // x$1: Object
<param> <synthetic> <triedcooking>
"x$1"
<tpt> // tree.tpe=Object
<empty>
)
<tpt> // tree.tpe=Boolean
Apply( // def ||(x: Boolean): Boolean in class Boolean, tree.tpe=Boolean
package$UnsupportedException.this.eq(x$1)."$bar$bar" // def ||(x: Boolean): Boolean in class Boolean, tree.tpe=(x: Boolean)Boolean
Apply( // def &&(x: Boolean): Boolean in class Boolean, tree.tpe=Boolean
{
case <synthetic> val x1: Object = x$1;
case5(){
if (x1.$isInstanceOf[scalanative.util.package$UnsupportedException]())
matchEnd4(true)
else
case6()
};
case6(){
matchEnd4(false)
};
matchEnd4(x: Boolean){
x
}
}."$amp$amp" // def &&(x: Boolean): Boolean in class Boolean, tree.tpe=(x: Boolean)Boolean
Block( // tree.tpe=Boolean
ValDef( // val UnsupportedException$1: scalanative.util.package$UnsupportedException
<synthetic> <triedcooking>
"UnsupportedException$1"
<tpt> // tree.tpe=scalanative.util.package$UnsupportedException
Apply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=scalanative.util.package$UnsupportedException
TypeApply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=()scalanative.util.package$UnsupportedException
"x$1"."$asInstanceOf" // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
<tpt> // tree.tpe=scalanative.util.package$UnsupportedException
)
Nil
)
)
Apply( // final def ==(x$1: Object): Boolean in class Object, tree.tpe=Boolean
package$UnsupportedException.this.msg()."$eq$eq" // final def ==(x$1: Object): Boolean in class Object, tree.tpe=(x$1: Object)Boolean
Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
"UnsupportedException$1"."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
Nil
)
)
)
)
)
)
DefDef( // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException
<method> <triedcooking>
"<init>"
[]
// 1 parameter list
ValDef( // msg: String
<param> <paramaccessor> <triedcooking>
"msg"
<tpt> // tree.tpe=String
<empty>
)
<tpt> // tree.tpe=scalanative.util.package$UnsupportedException
Block( // tree.tpe=Unit
// 3 statements
Assign( // tree.tpe=Unit
package$UnsupportedException.this."msg " // private[this] val msg: String in class package$UnsupportedException, tree.tpe=String
"msg" // msg: String, tree.tpe=String
)
Apply( // def <init>(x$1: String): Exception in class Exception, tree.tpe=Exception
package$UnsupportedException.super."<init>" // def <init>(x$1: String): Exception in class Exception, tree.tpe=(x$1: String)Exception
"msg" // msg: String, tree.tpe=String
)
Apply( // def $init$(x$1: Product): Unit in object Product$class, tree.tpe=Unit
"scala"."Product$class"."$init$" // def $init$(x$1: Product): Unit in object Product$class, tree.tpe=(x$1: Product)Unit
This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
)
()
)
)
)
== Expanded type of tree ==
ConstantType(value = Constant(scalanative.nir.Dep.Dep$Conditional))
how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: scala/scalanative/util/package$UnsupportedException
at scala.tools.nsc.backend.jvm.GenASM$JBuilder.javaName(GenASM.scala:548)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genObjsInstr$1(GenASM.scala:2465)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.scala$tools$nsc$backend$jvm$GenASM$JPlainBuilder$$genInstr$1(GenASM.scala:2471)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder$$anonfun$genBlock$1$2.apply(GenASM.scala:2352)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder$$anonfun$genBlock$1$2.apply(GenASM.scala:2338)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at scala.tools.nsc.backend.icode.BasicBlocks$BasicBlock.foreach(BasicBlocks.scala:197)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genBlock$1(GenASM.scala:2338)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genBlocks$1(GenASM.scala:2269)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genCode(GenASM.scala:2882)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genMethod(GenASM.scala:1589)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1400)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:68)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:67)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:95)
at sbt.inc.Incremental$.compile(Incremental.scala:67)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
at sbt.Compiler$.compile(Compiler.scala:152)
at sbt.Compiler$.compile(Compiler.scala:138)
at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:860)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:851)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:849)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (compile:compileIncremental) java.lang.AssertionError: assertion failed:
[error] while compiling: /Users/bkeller/src/scala-native/util/src/main/scala/scala/scalanative/util/package.scala
[error] during phase: jvm
[error] library version: version 2.10.6
[error] compiler version: version 2.10.6
[error] reconstructed args: -classpath /Users/bkeller/src/scala-native/project/target/scala-2.10/sbt-0.13/classes:/Users/bkeller/.sbt/0.13/plugins/target/scala-2.10/sbt-0.13/classes:/Users/bkeller/.ivy2/cache/scala_2.10/sbt_0.13/org.ensime/ensime-sbt/jars/ensime-sbt-0.3.2.jar:/Users/bkeller/.ivy2/cache/org.scala-lang/scalap/jars/scalap-2.10.6.jar:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-compiler.jar:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-reflect.jar:/Users/bkeller/.ivy2/cache/org.scalariform/scalariform_2.10/jars/scalariform_2.10-0.1.4.jar:/Users/bkeller/.ivy2/cache/commons-io/commons-io/jars/commons-io-2.4.jar:/Users/bkeller/.ivy2/cache/scala_2.10/sbt_0.13/com.geirsson/sbt-scalafmt/jars/sbt-scalafmt-0.2.3.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/sbt/jars/sbt-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/main/jars/main-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/actions/jars/actions-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/classpath/jars/classpath-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/interface/jars/interface-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/io/jars/io-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/control/jars/control-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/launcher-interface/jars/launcher-interface-1.0.0-M1.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/completion/jars/completion-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/collections/jars/collections-0.13.11.jar:/Users/bkeller/.ivy2/cache/jline/jline/jars/jline-2.13.jar:/Users/bkeller/.ivy2/cache/org.fusesource.jansi/jansi/jars/jansi-1.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/api/jars/api-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/classfile/jars/classfile-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/logging/jars/logging-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/process/jars/process-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-integration/jars/compiler-integration-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/incremental-compiler/jars/incremental-compiler-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/relation/jars/relation-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compile/jars/compile-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/persist/jars/persist-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-tools.sbinary/sbinary_2.10/jars/sbinary_2.10-0.4.2.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-ivy-integration/jars/compiler-ivy-integration-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/ivy/jars/ivy-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/cross/jars/cross-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt.ivy/ivy/jars/ivy-2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a.jar:/Users/bkeller/.ivy2/cache/com.jcraft/jsch/jars/jsch-0.1.46.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/serialization_2.10/jars/serialization_2.10-0.1.2.jar:/Users/bkeller/.ivy2/cache/org.scala-lang.modules/scala-pickling_2.10/jars/scala-pickling_2.10-0.10.1.jar:/Users/bkeller/.ivy2/cache/org.scalamacros/quasiquotes_2.10/jars/quasiquotes_2.10-2.0.1.jar:/Users/bkeller/.ivy2/cache/org.json4s/json4s-core_2.10/jars/json4s-core_2.10-3.2.10.jar:/Users/bkeller/.ivy2/cache/org.json4s/json4s-ast_2.10/jars/json4s-ast_2.10-3.2.10.jar:/Users/bkeller/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.6.jar:/Users/bkeller/.ivy2/cache/org.spire-math/jawn-parser_2.10/jars/jawn-parser_2.10-0.6.0.jar:/Users/bkeller/.ivy2/cache/org.spire-math/json4s-support_2.10/jars/json4s-support_2.10-0.6.0.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/run/jars/run-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/task-system/jars/task-system-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/tasks/jars/tasks-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/tracking/jars/tracking-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/cache/jars/cache-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/testing/jars/testing-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/test-agent/jars/test-agent-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/test-interface/jars/test-interface-1.0.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/main-settings/jars/main-settings-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/apply-macro/jars/apply-macro-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/command/jars/command-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/logic/jars/logic-0.13.11.jar:/Users/bkeller/.ivy2/cache/org.scala-sbt/compiler-interface/jars/compiler-interface-0.13.11.jar -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/jre/classes:/Users/bkeller/.sbt/boot/scala-2.10.6/lib/scala-library.jar
[error]
[error] last tree to typer: Literal(Constant(scalanative.nir.Dep.Dep$Conditional))
[error] symbol: null
[error] symbol definition: null
[error] tpe: Class(classOf[scala.scalanative.nir.Dep$Conditional])
[error] symbol owners:
[error] context owners: class package$UnsupportedException -> package util
[error]
[error] == Enclosing template or block ==
[error]
[error] Template( // val <local UnsupportedException>: <notype> in class package$UnsupportedException, tree.tpe=scalanative.util.package$UnsupportedException
[error] "java.lang.Exception", "scala.Product", "scala.Serializable" // parents
[error] ValDef(
[error] private
[error] "_"
[error] <tpt>
[error] <empty>
[error] )
[error] // 12 statements
[error] ValDef( // private[this] val msg: String in class package$UnsupportedException
[error] private <local> <caseaccessor> <paramaccessor> <triedcooking>
[error] "msg "
[error] <tpt> // tree.tpe=String
[error] <empty>
[error] )
[error] DefDef( // val msg(): String in class package$UnsupportedException
[error] <method> <stable> <caseaccessor> <accessor> <paramaccessor> <triedcooking>
[error] "msg"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=String
[error] package$UnsupportedException.this."msg " // private[this] val msg: String in class package$UnsupportedException, tree.tpe=String
[error] )
[error] DefDef( // def copy(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException
[error] <method> <synthetic>
[error] "copy"
[error] []
[error] // 1 parameter list
[error] ValDef( // msg: String
[error] <param> <defaultparam/trait> <triedcooking>
[error] "msg"
[error] <tpt> // tree.tpe=String
[error] <empty>
[error] )
[error] <tpt> // tree.tpe=scalanative.util.package$UnsupportedException
[error] Apply( // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException, tree.tpe=scalanative.util.package$UnsupportedException
[error] new scalanative.util.package$UnsupportedException."<init>" // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException, tree.tpe=(msg: String)scalanative.util.package$UnsupportedException
[error] "msg" // msg: String, tree.tpe=String
[error] )
[error] )
[error] DefDef( // def copy$default$1(): String in class package$UnsupportedException
[error] <method> <synthetic> <defaultparam/trait>
[error] "copy$default$1"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=String
[error] Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
[error] package$UnsupportedException.this."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
[error] Nil
[error] )
[error] )
[error] DefDef( // override def productPrefix(): String in class package$UnsupportedException
[error] <method> override <synthetic>
[error] "productPrefix"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=String
[error] "UnsupportedException"
[error] )
[error] DefDef( // def productArity(): Int in class package$UnsupportedException
[error] <method> <synthetic>
[error] "productArity"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=Int
[error] 1
[error] )
[error] DefDef( // def productElement(x$1: Int): Object in class package$UnsupportedException
[error] <method> <synthetic>
[error] "productElement"
[error] []
[error] // 1 parameter list
[error] ValDef( // x$1: Int
[error] <param> <synthetic> <triedcooking>
[error] "x$1"
[error] <tpt> // tree.tpe=Int
[error] <empty>
[error] )
[error] <tpt> // tree.tpe=Object
[error] Block( // tree.tpe=Object
[error] ValDef( // case val x1: Int
[error] case <synthetic> <triedcooking>
[error] "x1"
[error] <tpt> // tree.tpe=Int
[error] "x$1" // x$1: Int, tree.tpe=Int
[error] )
[error] Match( // tree.tpe=Object
[error] Typed( // tree.tpe=Int
[error] "x1" // case val x1: Int, tree.tpe=Int
[error] <tpt> // tree.tpe=Int
[error] )
[error] // 2 cases
[error] CaseDef( // tree.tpe=String
[error] 0
[error] Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
[error] package$UnsupportedException.this."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
[error] Nil
[error] )
[error] )
[error] CaseDef( // tree.tpe=Nothing
[error] "_" // tree.tpe=Int
[error] Throw( // tree.tpe=Nothing
[error] Apply( // def <init>(x$1: String): IndexOutOfBoundsException in class IndexOutOfBoundsException, tree.tpe=IndexOutOfBoundsException
[error] new IndexOutOfBoundsException."<init>" // def <init>(x$1: String): IndexOutOfBoundsException in class IndexOutOfBoundsException, tree.tpe=(x$1: String)IndexOutOfBoundsException
[error] Apply( // def toString(): String in class Object, tree.tpe=String
[error] scala.Int.box(x$1)."toString" // def toString(): String in class Object, tree.tpe=()String
[error] Nil
[error] )
[error] )
[error] )
[error] )
[error] )
[error] )
[error] )
[error] DefDef( // override def productIterator(): Iterator in class package$UnsupportedException
[error] <method> override <synthetic>
[error] "productIterator"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=Iterator
[error] Apply( // def typedProductIterator(x: Product): Iterator in object ScalaRunTime, tree.tpe=Iterator
[error] runtime.this."ScalaRunTime"."typedProductIterator" // def typedProductIterator(x: Product): Iterator in object ScalaRunTime, tree.tpe=(x: Product)Iterator
[error] This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
[error] )
[error] )
[error] DefDef( // def canEqual(x$1: Object): Boolean in class package$UnsupportedException
[error] <method> <synthetic>
[error] "canEqual"
[error] []
[error] // 1 parameter list
[error] ValDef( // x$1: Object
[error] <param> <synthetic> <triedcooking>
[error] "x$1"
[error] <tpt> // tree.tpe=Object
[error] <empty>
[error] )
[error] <tpt> // tree.tpe=Boolean
[error] Apply( // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=Boolean
[error] TypeApply( // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=()Boolean
[error] "x$1"."$isInstanceOf" // final def $isInstanceOf[T0 >: ? <: ?](): Boolean in class Object, tree.tpe=[T0 >: ? <: ?]()Boolean
[error] <tpt> // tree.tpe=scalanative.util.package$UnsupportedException
[error] )
[error] Nil
[error] )
[error] )
[error] DefDef( // override def hashCode(): Int in class package$UnsupportedException
[error] <method> override <synthetic>
[error] "hashCode"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=Int
[error] Apply( // def _hashCode(x: Product): Int in object ScalaRunTime, tree.tpe=Int
[error] ScalaRunTime.this."_hashCode" // def _hashCode(x: Product): Int in object ScalaRunTime, tree.tpe=(x: Product)Int
[error] This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
[error] )
[error] )
[error] DefDef( // override def equals(x$1: Object): Boolean in class package$UnsupportedException
[error] <method> override <synthetic>
[error] "equals"
[error] []
[error] // 1 parameter list
[error] ValDef( // x$1: Object
[error] <param> <synthetic> <triedcooking>
[error] "x$1"
[error] <tpt> // tree.tpe=Object
[error] <empty>
[error] )
[error] <tpt> // tree.tpe=Boolean
[error] Apply( // def ||(x: Boolean): Boolean in class Boolean, tree.tpe=Boolean
[error] package$UnsupportedException.this.eq(x$1)."$bar$bar" // def ||(x: Boolean): Boolean in class Boolean, tree.tpe=(x: Boolean)Boolean
[error] Apply( // def &&(x: Boolean): Boolean in class Boolean, tree.tpe=Boolean
[error] {
[error] case <synthetic> val x1: Object = x$1;
[error] case5(){
[error] if (x1.$isInstanceOf[scalanative.util.package$UnsupportedException]())
[error] matchEnd4(true)
[error] else
[error] case6()
[error] };
[error] case6(){
[error] matchEnd4(false)
[error] };
[error] matchEnd4(x: Boolean){
[error] x
[error] }
[error] }."$amp$amp" // def &&(x: Boolean): Boolean in class Boolean, tree.tpe=(x: Boolean)Boolean
[error] Block( // tree.tpe=Boolean
[error] ValDef( // val UnsupportedException$1: scalanative.util.package$UnsupportedException
[error] <synthetic> <triedcooking>
[error] "UnsupportedException$1"
[error] <tpt> // tree.tpe=scalanative.util.package$UnsupportedException
[error] Apply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=scalanative.util.package$UnsupportedException
[error] TypeApply( // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=()scalanative.util.package$UnsupportedException
[error] "x$1"."$asInstanceOf" // final def $asInstanceOf[T0 >: ? <: ?](): T0 in class Object, tree.tpe=[T0 >: ? <: ?]()T0
[error] <tpt> // tree.tpe=scalanative.util.package$UnsupportedException
[error] )
[error] Nil
[error] )
[error] )
[error] Apply( // final def ==(x$1: Object): Boolean in class Object, tree.tpe=Boolean
[error] package$UnsupportedException.this.msg()."$eq$eq" // final def ==(x$1: Object): Boolean in class Object, tree.tpe=(x$1: Object)Boolean
[error] Apply( // val msg(): String in class package$UnsupportedException, tree.tpe=String
[error] "UnsupportedException$1"."msg" // val msg(): String in class package$UnsupportedException, tree.tpe=()String
[error] Nil
[error] )
[error] )
[error] )
[error] )
[error] )
[error] )
[error] DefDef( // def <init>(msg: String): scalanative.util.package$UnsupportedException in class package$UnsupportedException
[error] <method> <triedcooking>
[error] "<init>"
[error] []
[error] // 1 parameter list
[error] ValDef( // msg: String
[error] <param> <paramaccessor> <triedcooking>
[error] "msg"
[error] <tpt> // tree.tpe=String
[error] <empty>
[error] )
[error] <tpt> // tree.tpe=scalanative.util.package$UnsupportedException
[error] Block( // tree.tpe=Unit
[error] // 3 statements
[error] Assign( // tree.tpe=Unit
[error] package$UnsupportedException.this."msg " // private[this] val msg: String in class package$UnsupportedException, tree.tpe=String
[error] "msg" // msg: String, tree.tpe=String
[error] )
[error] Apply( // def <init>(x$1: String): Exception in class Exception, tree.tpe=Exception
[error] package$UnsupportedException.super."<init>" // def <init>(x$1: String): Exception in class Exception, tree.tpe=(x$1: String)Exception
[error] "msg" // msg: String, tree.tpe=String
[error] )
[error] Apply( // def $init$(x$1: Product): Unit in object Product$class, tree.tpe=Unit
[error] "scala"."Product$class"."$init$" // def $init$(x$1: Product): Unit in object Product$class, tree.tpe=(x$1: Product)Unit
[error] This("UnsupportedException")final case class package$UnsupportedException extends Exception with Product with Serializable in package util, tree.tpe=scalanative.util.package$UnsupportedException
[error] )
[error] ()
[error] )
[error] )
[error] )
[error]
[error] == Expanded type of tree ==
[error]
[error] ConstantType(value = Constant(scalanative.nir.Dep.Dep$Conditional))
[error]
[error] how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: scala/scalanative/util/package$UnsupportedException
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
[error] Not a valid command: package
[error] package
[error]
This is a blocker for releasing any kind of stable release of scala-native.
Once module is loaded, any subsequent module loads that are being dominated by the load should re-use the value.
Ubuntu 14.04
java version "1.8.0_91"
sbt-0.13.11
[debug] :: resolution report :: resolve 5217ms :: artifacts dl 24395ms
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[warn] :: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
Subsequent box/unbox pairs should disappear and be replaced with original value.
Currently one can't call C functions that have vararg agruments. We need some extra work in the front-end to make it happen.
Current pointer type is not able to express function pointers. Considering the fact that one can not have function type anywhere but underneath a pointer it would make sense to have a separate pointer type for that.
Functionality:
FunctionPtrN[.. $T]
funptr(.. $args)
FunctionPtr.to(externFunction _)
Materials:
Initial interop #16:
sizeof
, cast
, c"..."
)Ptr[T]
@extern object
@struct class
Tools:
Library:
Key functionality:
mainClass
to automatically discover the entry pointFeatures:
java.lang.String
from Apache HarmonyMVP:
UByte
, UShort
, UInt
, ULong
CChar
, CInt
, ...
, CSize
cast[T](x)
// bitcastsizeof[T]
c"..."
(C string)Ptr[T]
core features
!ptr
!ptr = value
ptr + offset
and ptr - offset
ptr(index)
ptr(index) = value
@extern object $name
var $name: $T = extern
val $name: $T = extern
def $name(.. $name: $T): $T = extern
@struct class $name(.. val $name: $T)
Introduce an additional annotations to have non-C struct layouts:
@simd
annotation that will map to LLVM-style vectorsJava8 backend of nsc and dotty produces closure trees that are meant to be desugared to LambdaMetaFactory on JVM. We have already added an IR-level op for that called closure[$ty] $funptr, ..$captures
but don't have a desugaring implemented for it yet.
This is not necessary for 2.11 but is a blocker for 2.12 and dotty front-ends.
It's currently used to discover classpath, we can probably do it manually with a bit of extra code.
For details see C# 7's proposal on this: dotnet/roslyn#118
This can be quite useful to debug linking errors.
https://github.com/scala-native/scala-native/tree/topic/dotty-support branch of scala-native together with https://github.com/densh/dotty/tree/nir fork of dotty contains initial work to integrate of dotty as Scala Native fronted. This is far from production ready and needs to be updated to reflect recent changes in the NIR.
It's a well-known technique that lets one pack integer numbers that fit into pointer value without allocation. Originally we planned it to have it from the start but it complicates support for 32/64-bit with the same code-base and also has complications wrt Boehm GC. We need to revisit this idea once we replace it with something better and have proper conditional compilation support.
https://www.dartlang.org/articles/numeric-computation/#smis-and-mints
Currently it's possible to use C structs that have union members through definition of multiple variants of the same struct and casting between them. This is a bit sub-optimal from the boilerplate point of view and it would be nice to have something more user friendly in this area.
It should be tracked by #45, but in case you cannot compile this project, here is my try.
Make sure you have sbt, java and clang installed. My version:
$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
$ sbt -version
sbt launcher version 0.13.8
$ clang++ -version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Thread model: posix
And optionally, if you don't have gc.h
in your lib path. Please refer to this to install it.
git clone https://github.com/scala-native/scala-native.git --recursive
cd scala-native
Note the recursive
option because scala-native requires scala as submodule.
$ sbt
project rtlib
publishLocal
project nscplugin
publishLocal
still in the sbt session
project demoNative
run
And Finally I got an error from clang++, which reads error: expected '{' in function body llvm
Hope this will help.
Unsafe (pointers, stack allocation, extern calls and friends) features can only be used in unsafe context:
@unsafe
methodsunsafe { ... }
blocksThis clearly demarcates usage of unsafe features, making it impossible to use them by accident.
This will be the initial foundation for the test suite.
Starting point: https://github.com/scala-js/scala-js/tree/master/partest/src/main/scala/scala/tools/partest/scalajs
I'm running ubuntu 14.04, java
langley@oak:$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
langley@oak:$ scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
and sbt-0.13.11
Here's what I see, any ideas? I tried nuking ~/.ivy2 and ~/.m2 and that had no effect.
langley@oak:$ sbt
[info] Loading project definition from /home/langley/lab/scala-native/project
[info] Updating {file:/home/langley/lab/scala-native/project/}scala-native-build...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading https://repo1.maven.org/maven2/com/geirsson/sbt-scalafmt_2.10_0.13/0.2.3/sbt-scalafmt-0.2.3.jar ...
[info] [SUCCESSFUL ] com.geirsson#sbt-scalafmt;0.2.3!sbt-scalafmt.jar (1189ms)
[info] Done updating.
[info] Compiling 61 Scala sources to /home/langley/lab/scala-native/project/target/scala-2.10/sbt-0.13/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.10.6. Compiling...
[info] Compilation completed in 7.381 s
[warn] there were 2 feature warning(s); re-run with -feature for details
[warn] one warning found
java.util.NoSuchElementException: head of empty stream
at scala.collection.immutable.Stream$Empty$.head(Stream.scala:1028)
at scala.collection.immutable.Stream$Empty$.head(Stream.scala:1026)
at scala.scalanative.sbtplugin.ScalaNativePluginInternal$$anonfun$projectSettings$3.apply(ScalaNativePluginInternal.scala:61)
at scala.scalanative.sbtplugin.ScalaNativePluginInternal$$anonfun$projectSettings$3.apply(ScalaNativePluginInternal.scala:61)
at sbt.Init$Value$$anonfun$apply$13.apply(Settings.scala:609)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$constant$1.apply(INode.scala:163)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$constant$1.apply(INode.scala:163)
at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] java.util.NoSuchElementException: head of empty stream
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Things that need to be covered in the guide:
It's already possible to debug Scala native code with LLDB but we need to provide source code position mapping to have better end-user experience.
As a gap stop measure to reduce GC gitter perhaps you can introduce memory regions.
Finding an equivalent for this in Scala is complicated:
Dynamic
and whitebox macros but that would make it unusable in IDEs and not portable to dotty. The syntax would be ptr.field
which is not the same but close enough.ptr->field
, it gets parsed as ptr.->(field)
, meaning that field
has to be in scope, defined somewhere else. I don't really see how can one make it happen without some dark arcane magic (untyped macros?).Workaround: (!ptr).field
. This will load a whole struct and then extract a field from it.
The annotation would let one bind to differently named external definition:
import scalanative.native._
@extern object stdio {
@name("__stdoutp") var stdout: Ptr[_] = extern
}
One way to do it would be to introduce a new CArray[T, N <: Size]
value type that corrresponds to C's T[N]
type. It must also have a constructor that automatically infers the length. One can get a mutable array by stack allocating a value type and mutating the resulting pointer.
Scala native is going to have a relaxed safety model with checked undefined behaviour similar to Scala.js. In development mode all situations that can cause undefined behaviour throw UndefinedBehaviourError
.
Guarded situations:
On the IR-level such checks are going to be represented through special guard $condition
op that throws the scala.scalantive.runtime.UndefinedBehaviourError
if condition is not true under development mode and does nothing in production mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.