Your favourite language gets closer to bare metal.
Scala Python C++ C Java Shell
Latest commit 275b809 Jan 18, 2017 @densh densh committed on GitHub Introduce infrastracture to test compiler & optimizer (#495)
The testing compiler is made of two distinct components, as is the
scala-native compiler:
 - The testing NIRCompiler
 - The testing Optimizer

First, the testing NIRCompiler is used to compile scala code to NIR and
test the `nscplugin` project.

Second, the testing Optimizer is used to test the optimizer, and
ensuring that it performs the right transformations during its passes.

There are now 3 environment variables that contain all the info the
testing compiler needs:

 - scalanative.testingcompiler.cp
   It contains everything the testing is going to need. That classpath
   is used to create a new classloader from which the testing compiler
   will be loaded.
 - scalanative.nscplugin.jar
   The absolute path to the packaged nscplugin.
 - scalanative.nativeruntime.cp
   Everything that the linker needs to have on classpath to do its job.
Permalink
Failed to load latest commit information.
benchmarks/src/main/scala Upgrade scalafmt to 0.5.1 (#461) Dec 23, 2016
bin Scalafmt wrapper script must account for the version (#462) Dec 24, 2016
demo Make @struct a private runtime specific API (#474) Jan 4, 2017
docker Fix #102 Jun 14, 2016
docs Implement backtraces using libunwind (#477) Jan 13, 2017
javalib/src/main/scala fixed a bug with Math.min on Doubles (#489) Jan 14, 2017
nativelib/src/main Implement backtraces using libunwind (#477) Jan 13, 2017
nir/src/main/scala/scala/scalanative/nir Use semicolon consistently as type ascriptions in HNIR (#464) Dec 27, 2016
nscplugin/src/main Implement backtraces using libunwind (#477) Jan 13, 2017
project Remove snapshot and publish sbt-cross locally to avoid fetching sbt-s… Nov 26, 2016
sandbox Use semicolon consistently as type ascriptions in HNIR (#464) Dec 27, 2016
sbt-scala-native/src/main/scala/scala/scalanative/sbtplugin Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017
scalalib/overrides-2.11/scala Implement backtraces using libunwind (#477) Jan 13, 2017
scripted-tests/run Implement backtraces using libunwind (#477) Jan 13, 2017
testing-compiler-interface/src/main/java/scala/scalanative/api Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017
testing-compiler/src/main/scala/scalanative/compiler Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017
tools/src Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017
unit-tests/src/main/scala Remove unnecessary import java.lang.MathSuite (#493) Jan 17, 2017
util/src/main/scala/scala/scalanative Upgrade scalafmt to 0.5.1 (#461) Dec 23, 2016
.gitignore Scalafmt wrapper script must account for the version (#462) Dec 24, 2016
.scalafmt.conf Migrate to Scalafmt 0.4.7 Oct 25, 2016
.travis.yml Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017
LICENSE Add license file May 11, 2016
README.md Add support for memory layout types (#472) Jan 3, 2017
build.sbt Introduce infrastracture to test compiler & optimizer (#495) Jan 18, 2017

README.md

Scala Native

Join the chat at https://gitter.im/scala-native/scala-native

Build Status

Scala Native is a new ahead-of-time compiler and lightweight managed runtime designed specifically for Scala. Project is currently in pre-release stage. Follow us on twitter to be first to know about upcoming updates.

Features

  • Low-level primitives.

    type Vec = CStruct3[Double, Double, Double]
    
    val vec = stackalloc[Vec] // allocate c struct on stack
    !vec._1 = 10.0            // initialize fields
    !vec._2 = 20.0
    !vec._3 = 30.0
    length(vec)               // pass by reference

    Pointers, structs, you name it. Low-level primitives let you hand-tune your application to make it work exactly as you want it to. You're in control.

  • Extern objects.

    @extern object stdlib {
      def malloc(size: CSize): Ptr[Byte] = extern
    }
    
    val ptr = stdlib.malloc(32)

    Calling C code has never been easier. With the help of extern objects you can seamlessly call native code without any runtime overhead.

  • Instant startup.

    > time hello-native
    hello, native!
    
    real    0m0.005s
    user    0m0.002s
    sys     0m0.002s
    

    Scala Native is compiled ahead-of-time via LLVM. This means that there is no sluggish warm-up phase that's common for just-in-time compilers. Your code is immediately fast and ready for action.

Community

Documentation

scala-native.readthedocs.io

License

Scala Native is distributed under the Scala license.