godot-scala-native

July 12, 2026 · View on GitHub

Release

A Scala Native language binding for Godot (a GDExtension), targeting gdext-level sophistication. Write your game classes in Scala, extend Godot engine classes directly, and they are auto-registered — compiled to a native library via Scala Native.

Quick start

Use the giter8 template — it scaffolds a ready-to-run Godot 4 + Scala project and carries the full instructions:

sbt new optical002/godot-scala-native-template.g8

Build dependencies

Building the GDExtension compiles Scala → Scala Native → LLVM/Clang → a native dynamic library, so a native toolchain is required in addition to the JVM one:

DependencyRequired versionPurpose
JDK17 (Temurin)Runs sbt / the Scala toolchain.
sbtlauncher (project pins 1.9.7)Build tool; the launcher self-fetches the pinned sbt.
LLVM / Clang≥ 16Scala Native compiles through LLVM/Clang.
C/C++ build toolsLinux: clang+lld · macOS: Xcode CLT · Windows: VS 2022 "Desktop development with C++"System toolchain Scala Native links against.
Boehm GC (libgc + gc.h, a.k.a. bdwgc)any recentThe extension links GC.boehm (-lgc); the header/lib must be on clang's search path.
Gitany recentClone / tooling.
Godot4.6.x (standard, not .NET)Loads the built library. Not installed by the script below.

Windows — install the dependencies with one command

On a fresh Windows machine, run this in PowerShell to install everything above except Godot:

irm https://raw.githubusercontent.com/optical002/godot-scala-native/main/install-toolchain.ps1 | iex

It detects what's already present, skips it, and installs the rest via winget (falling back to Scoop when winget is unavailable). Installs are idempotent, so the command is safe to re-run. VS C++ Build Tools may prompt for admin.

⚠️ Known limitation — the script fails at the Boehm GC step on Windows. The automated vcpkg / bdwgc install does not currently work; the script installs everything else (JDK 17, sbt, LLVM/Clang, VS C++ Build Tools, Git) and then errors when it reaches Boehm GC. You must install and wire up Boehm GC manually — install bdwgc (e.g. via vcpkg: vcpkg install bdwgc:x64-windows) and set C_INCLUDE_PATH (to the dir with gc.h) and LIBRARY_PATH (to the dir with the lib) so clang can find them before building. This is unresolved; contributions welcome.

Note: Boehm GC on Windows in Scala Native's multithreaded mode is also a known upstream rough edge — even once it links, the first sbt godotBuild is where the .dll build is confirmed.

On Linux/macOS, install the toolchain from the table via your package manager (see BUILD.md and the Scala Native setup guide).

Artifacts

Released on JitPack under the group com.github.optical002.godot-scala-native:

  • sbt-godot-scala-native — the sbt plugin a game project adds (it injects everything else)
  • scala-native-gdextension — the binding library itself
// project/plugins.sbt
resolvers += "jitpack" at "https://jitpack.io"
addSbtPlugin("com.github.optical002.godot-scala-native" % "sbt-godot-scala-native" % "<version>")

Companion game-development libraries (reactive cells, HOCON config, prefabs, …) live in godot-scala-native-utilities.