Scala Native is an optimising ahead-of-time compiler for the Scala programming language. Traditionally, a virtual machine, the JVM, was required to run Scala programs. Scala Native taps into the compiler to emit LLVM intermediate representation rather than JVM bytecode. Then, the LLVM compiler infrastructure is used to produce native libraries and executables. Given that Scala Native executables are stand-alone programs, they generally have a shorter start-up time and low memory consumption. This opens up new avenues to deploy Scala programs where previously the virtual machine would be the limiting factor. For example, developers could write programs for the command line or embedded devices.
- Tutorials and Examples
- Build Tools
- Functional Programming
- Unit Tests
- File Formats and Parsers
- Web Development
Tutorials and Examples
- Giter8 template for a minimal Scala Native project - Official Giter8 template for a minimal Scala Native project.
- Hands on Scala Native - Tutorial for implementing a bandwidth monitor with Ncurses.
- Starter for Scala Native - Scala Native project that links to a custom C library.
- Building C code using sbt-jni - Example for compiling C code in a Scala Native project using sbt-jni.
- Example project with external dependencies - Example project that uses external dependencies to generate HTML and run a test suite.
- Starter for Gtk+ Projects - Giter8 template for Scala Native GUI projects using Gtk+.
- Modern systems programming with scala native book.
- Write a simple CLI application in Scala Native
- sbt - Scala's standard build tool.
- Mill - Build tool striving for simplicity, inspired by Bazel.
- Bloop - Scala build server and command-line tool for fast developer workflows.
- Seed - Build tool based on Bloop. Focuses on user experience and cross-platform builds, inspired by Cargo.
- Shapeless - Library for generic programming.
- Squants - DSL for quantities, units of measure and dimensional analysis.
- scalaz - Type classes and instances for data structures.
- nobox - Immutable primitive array wrapper without boxing.
- PPrint - Pretty-print values and types.
- SourceCode - Implicits providing meta data similar to
- reactify - Functional Reactive Programming framework for Scala.
- chimney - Boilerplate-free data transformations.
- Quicklens - Modify deeply nested case class fields.
- µTest - Library for unit tests.
- minitest - Lightweight testing library.
- scalaprops - Library for property-based testing.
- ScalaCheck - Property-based testing for Scala.
- ScalaTest - Testing library.
- specs2 - Software Specifications for Scala.
- Makeshift - Library for unit tests.
- MUnit - Scala testing library with actionable errors and extensible APIs.
- cmark - Bindings for the cmark CommonMark parser library.
- libuv - Bindings for libuv, a library for asynchronous I/O.
- SDL2 and OpenGL - Bindings for the graphical frameworks SDL2 and OpenGL.
- Cocoa - Bindings for the macOS graphical framework Cocoa.
- GNU Scientific Library - Bindings for GNU Scientific Library (GSL).
- BLAS - Bindings for BLAS, a library for Linear Algebra.
- Gtk+ - Bindings for the GTK+ graphical toolkit.
- libsoup - Bindings for the libsoup HTTP client/server library.
- libui - GUI framework based on libui.
- GStreamer - Bindings for the GStreamer multimedia framework.
- Qt - Bindings for Qt.
- ncurses - Bindings for the GNU Ncurses Library.
- readline - Bindings for the GNU Readline Library.
- libsndfile - Bindings for the Libsndfile C library for sampled sound manipulation.
- libpng - Bindings for the libpng C reference library for reading and writing PNGs.
- libcairo - Bindings for the Cairo 2D graphics C library.
- cairo-xlib - Bindings for the Cairo 2D graphics XLib Surfaces with bindings for XLib as well.
- libyaml - Bindings for the LibYAML C library for parsing YAML.
- iup - Bindings for the IUP multi-platform toolkit for building graphical user interfaces.
File Formats and Parsers
- msgpack4z - Implementation of MessagePack, a binary serialisation format.
- FastParse - Library for defining and running parsers.
- scalatags - HTML/XML construction and rendering.
- Pine - HTML/XML parsing, manipulation and rendering.
- scala-json - JSON parser.
- uJson - fast, flexible and intuitive JSON for Scala
- toml-scala - TOML parser with codec derivation.
- argonaut - Purely functional JSON parser and library.
- ScalaPB - Protocol Buffer compiler for Scala.
- sconfig - HOCON parser.
- squiggly - Cross-platform template language for Scala, inspired by Liquid and Hugo templates.
- JDBC - Port of the database access layer JDBC to Scala Native.
- SQLite4S - Port of the Java library Sqlite4java. Includes bindings for the SQLite native library.
- Trail - Routing library.
- sttp - HTTP Client library.
- snunit - Scala Native HTTP server based on NGINX Unit.
- scala-native-loop - Event loop and async-oriented IO for Scala Native
- castor - Lightweight, typed Actor library for Scala.
- scribe - Fast and simple logging library.
- slogging - Typesafe-logging and SLF4J-compatible logging library based on macros.
- fansi - Library for creating ANSI-coloured strings.
- scopt - Command-line argument parser.
- scala-optparse-applicative - Port of Haskell's CLI argument parsing library optparse-applicative.
- scallop - A simple Scala CLI parsing library.
- Potassium - Framework for writing robot software.
- WPILib - Reimplementation of the FIRST Robotics WPILib libraries.
- sglgears - Port of GL gears.c.
- k8s-cli - CLI tools to generate Kubernetes resources for Akka, Play Framework and Lagom-based applications.
- Coursier - Coursier's
bootstrapcommand generates native launchers.
- fractals - A self-similar fractal generator with basic animation support.
- Seed Docker image - Docker image for cross-platform builds with Seed.
- scala-native-sbt-docker - Docker image for Scala Native and sbt.
This work is licenced under a Creative Commons Attribution 4.0 International Licence.