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

Proper schema syntax #51

Open
carueda opened this issue Jul 2, 2019 · 3 comments
Open

Proper schema syntax #51

carueda opened this issue Jul 2, 2019 · 3 comments

Comments

@carueda
Copy link
Owner

carueda commented Jul 2, 2019

The use of the Lightbend/Typesafe Config library itself for purposes of parsing the input used to generate the wrapper has a number of limitations and counter-intuitive effects, in concrete when doing the automatic type detection from given values (NOTE: explicit types are not an issue). See for example #41, #50, #46.

This is not a fault of that library but rather a consequence of using it to infer the types. In particular, note that Lightbend/Typesafe Config:

  • i) deals with concrete config input (as opposed to a schema as used in tscfg)
  • ii) it complementarily offers multiple ways to get the value of the particular parameter, including getInt, getDouble, etc., so, in other words, it defers to the user to decide how to access the value.

The proposal here is to define a proper syntax/language more appropriate for schema definition purposes and, along with that, implement/use a corresponding parsing mechanism. Although tscfg is not yet v1, perhaps consider forcing the new proper syntax as the default in some stable version, while also adding an option to indicate the particular input language.

Reactions/comments welcome.

@pambrose
Copy link

pambrose commented Jul 6, 2019

Antlr (https://www.antlr.org) makes writing that sort of thing really easy.

@carueda
Copy link
Owner Author

carueda commented Jul 6, 2019

Thanks for the suggestion. When the times comes, https://github.com/lihaoyi/fastparse/ would actually be my first option as I have other Scala projects already using it and it's simply great.

@carueda
Copy link
Owner Author

carueda commented Jan 20, 2022

Just to note that I've been having a great experience with cats-parse in some other project where I successfully migrated from fastparse, which, unfortunately seems like it is not going to be updated to Scala 3 any time soon.

@carueda carueda mentioned this issue Apr 13, 2022
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants