Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why replace Typesafe Config on JVM? #19

Open
jokade opened this issue Jul 13, 2017 · 5 comments
Open

Why replace Typesafe Config on JVM? #19

jokade opened this issue Jul 13, 2017 · 5 comments

Comments

@jokade
Copy link
Contributor

jokade commented Jul 13, 2017

A somewhat provocative question, but: why do you implement a replacement for Typesafe Config on JVM? Although it's nice being able to add a single dependency for configuration to a cross project, it's not really much effort to add Typesafe config and shocon separately to JVM and JS projects, respectively.

I'm asking because it's quite easy to collect all reference.conf files at compile time for Scala.js using an sbt plugin, but duplicating Typesafe configs elaborate strategy for runtime loading from the classpath seems like an unnecessary effort?

Edit: you could actually provide a dummy shocon package for JVM that simply depends on Typesafe Config; that way one would only need to add the shocon package to the cross project...

@evacchi
Copy link
Collaborator

evacchi commented Jul 14, 2017

the point is not to implement a replacement for Typesafe Config on the JVM, but to provide a an implementation that cross-compiles for the Scala Ecosystem.

Most Scala Config libraries act as a thin wrapper over the Java source code, with a Scala-idiomatic API. This project is a full Scala implementation with a Scala-idiomatic API, that happens to provide a Java-compatible shim (which I would happily drop, to be fair).

Personally, I am also open to suggestions to improve the situation of the merge/load semantics. I believe we do not probably need to be 100% compatible with the original implementation :)

@andreaTP
Copy link
Member

just to add that there are few semantics difference in between shocon and TypesafeConfig, and you are free to choose what to import in JVM projects

@ryantheleach
Copy link

Are the semantic differences spec breaking or only in disambiguous cases?

@andreaTP
Copy link
Member

on API level there are things that are totally unavailable on JS (like load from File).
moreover you can observe different behaving with numbers due to Scala.JS itself

@ryantheleach
Copy link

My question was largely related to running both on the JVM.

@jokade One advantage of having the ability to run it on the JVM though is simplified unit testing of differences that might arrive, comparing it to the reference implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants