Search code examples
scalajson4s

Why does json4s need a Scala compiler as a runtime dependency


I've discovered that by using json4s native

    <dependency>
        <groupId>org.json4s</groupId>
        <artifactId>json4s-native_2.10</artifactId>
        <version>3.2.9</version>
    </dependency>

brings scalap and scala-compiler dependencies.

Why does it need it?

Does it generate code on the fly at runtime?

Why doesn't it use macros that do this processing at compile time?


Solution

  • The people of json4s have answered me in this issue the following:

    Because we need to read the byte code to find out information about scala primitives. This is more necessary on 2.9 than it is on 2.10