Scala Native¶
Version 0.4.14-SNAPSHOT
Scala Native is an optimizing ahead-of-time compiler and lightweight managed runtime designed specifically for Scala. It 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.
Seamless interop with native code.
@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.
> 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 Gitter chat 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
- Libraries
- Contributor’s Guide
- Blog
- Changelog
- 0.4.13 (2023-06-05)
- 0.4.12 (2023-03-22)
- 0.4.11 (2023-03-15)
- 0.4.10 (2023-01-27)
- 0.4.9 (2022-11-23)
- 0.4.8 (2022-11-09)
- 0.4.7 (2022-09-01)
- 0.4.6 (2022-09-01)
- 0.4.5 (2022-06-27)
- 0.4.4 (2022-03-02)
- 0.4.3 (2022-01-21)
- 0.4.3-RC2 (2022-01-11)
- 0.4.3-RC1 (2022-01-04)
- 0.4.2 (2021-12-06)
- 0.4.1 (2021-10-20)
- 0.4.0 (Jan 19, 2021)
- 0.4.0-M2 (May 23, 2019)
- 0.4.0-M1 (May 23, 2019)
- 0.3.9 (Apr 23, 2019)
- 0.3.8 (Jul 16, 2018)
- 0.3.7 (Mar 29, 2018)
- 0.3.6 (Dec 12, 2017)
- 0.3.5 (Dec 12, 2017)
- 0.3.4 (Dec 12, 2017)
- 0.3.3 (Sep 7, 2017)
- 0.3.2 (Aug 8, 2017)
- 0.3.1 (June 29, 2017)
- 0.3.0 (June 15, 2017)
- 0.2.1 (April 27, 2017)
- 0.2.0 (April 26, 2017)
- 0.1.0 (March 14, 2017)
- FAQ