GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • User’s Guide
  • Libraries
  • Contributor’s Guide
  • Blog
  • Changelog
  • FAQ

This view

  • Original page
  • New address

GeezerVison is showing scala-native.org — Scala Native — Scala Native 0.5.13-20261111-9be93b7-SNAPSHOT documentation

Scala Native¶

Releases [1]

Type

Version

Stable

0.5.12

Latest

0.5.13-20261111-9be93b7-SNAPSHOT

Scala Native is an optimizing ahead-of-time compiler and lightweight managed runtime designed specifically for Scala. It features:

  • Low-level primitives.

    import scala.scalanative.unsafe._
    
    type Vec = CStruct3[Double, Double, Double]
    
    def sum(vec: Ptr[Vec]): Double =
      return vec._1 + vec._2 + vec._3
    
    @main def main(): Unit =
      val vec = stackalloc[Vec]() // allocate c struct on stack
      vec._1 = 10.0             // initialize fields
      vec._2 = 20.0
      vec._3 = 30.0
      println(sum(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.

  • Seamless interop with native code.

    import scala.scalanative.unsafe._
    import scala.scalanative.unsigned._
    
    @extern object stdlib {
      def malloc(size: CSize): Ptr[Byte] = extern
    }
    
    val ptr = stdlib.malloc(32.toCSize)
    

    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.

    > 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¶

  • Want to follow project updates? Follow us on twitter.

  • Want to chat? Join our Discord channel.

  • Have a question? Ask it on Stack Overflow with tag scala-native.

  • Found a bug or want to propose a new feature? Open an issue on GitHub.

Documentation¶

This documentation is divided into different parts. It’s recommended to go through the User’s Guide to get familiar with Scala Native. Libraries will walk you through all the known libraries that are currently available. Contributor’s Guide contains valuable information for people who want to either contribute to the project or learn more about the internals and the development process behind the project.

  • User’s Guide
    • Environment setup
    • Building projects with sbt
    • Language semantics
    • Native code interoperability
    • Embedding Scala Native
    • Native Code in your Application or Library
    • Testing
    • Profiling
    • Runtime / Garbage Collector Settings
    • Release types
  • Libraries
    • Java Standard Library
    • ISO/IEC C Standard Library
    • C POSIX Library
    • Community Libraries
  • Contributor’s Guide
    • Quick Start Guide
    • Contributing guidelines
    • Guide to the sbt build
    • The compiler plugin and code generator
    • Native Intermediate Representation
    • Name mangling
    • Build Environment Setup
    • IDE setup
    • Appendix A: Finding main methods in .ll files
  • Blog
    • Interflow: Scala Native’s upcoming flow-sensitive, profile-guided optimizer
  • Changelog
    • 0.5.x series
    • 0.4.x series
  • FAQ
    • Troubleshooting
[1]

See Release types

Document built at : 2026-11-12

©2016-2026, EPFL. | Powered by Sphinx 7.2.6 & Alabaster 0.7.16
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.