Let's take a walk through a simple Scala Native application setup:
The source code is split into library and application:
- library with a function that generates a greeting for a given name
- application that runs the function
git clone [email protected]:Tapad/scala-native-workshop.git
# Needed to build
brew install llvm
# Optional, but will be required by this CLI. Please install these as well.
brew install bdw-gc re2 jansson
sudo apt install clang libunwind-dev
sudo apt install libgc-dev libre2-dev # optional
To run the application from SBT one can just type:
> sbt 'app/run World!'
The application can be build using:
> sbt 'app/nativeLink'
and run via:
> cd ./app/target/scala-2.11
> ./app-out World
Hello, World!
Check out intermediate representation in a .nir
file.
NIR docs.