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.
- Download the native
sn-demanglerbinary 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>
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).
-
Demangle a single string:
$ sn-demangler 'hello _SM36scala.scalanative.runtime.BoxedUnit$G8instance world' hello scala.scalanative.runtime.BoxedUnit$.<generated> instance world -
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 -
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
A webapp is available: https://indoorvivants.github.io/sn-demangler/