indoorvivants / sn-demangler   0.2.0

Apache License 2.0 Website GitHub

Scala Native name demangler

Scala versions: 3.x 2.13 2.12
Scala.js versions: 1.x
Scala Native versions: 0.5

Scala Native name demangler

sn-demangler Scala version support sn-demangler-core Scala version support

Why?

Scala Native mangles names in the binaries according to a particular scheme:

https://scala-native.readthedocs.io/en/latest/contrib/mangling.html

This project parses the mangled name back into a more readable format. It is distributed as both a runnable application, and an embeddable library.

Available as a native CLI, as a Webapp, and as a normal library published for JVM, JS, and Native.

Installation

  • Download the native sn-demangler binary for your platform from Github Releases
  • Use the Web version
  • Launch the JVM version directly from Coursier:
    cs launch com.indoorvivants::sn-demangler:latest.release -- <args>
    

Usage

Demangler will attempt to find all SN identifiers, demangle them, and display the symbols inline with the rest of the text.

Let's say you have text like this:

hello _SM36scala.scalanative.runtime.BoxedUnit$G8instance world

The demangled symbols will be highlighted in the console (disable that with --plain or set NO_COLOR=true env variable).

CleanShot 2026-04-09 at 13 23 54@2x
  1. Demangle a single string:

    $ sn-demangler 'hello _SM36scala.scalanative.runtime.BoxedUnit$G8instance world'
    hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world
    
  2. Demangle a file:

    $ cat myfile
    hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world
    
    $ sn-demangler -f myfile
    hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world
    
  3. Demangle from STDIN:

    $ cat myfile
    hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world
    
    $ cat myfile | sn-demangler -f -
    hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world
    

Webapp

A webapp is available: https://indoorvivants.github.io/sn-demangler/

CleanShot 2026-04-09 at 13 22 21@2x