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

JSON PSL/Runtime Config #274

Open
eriq-augustine opened this issue May 21, 2020 · 5 comments
Open

JSON PSL/Runtime Config #274

eriq-augustine opened this issue May 21, 2020 · 5 comments

Comments

@eriq-augustine
Copy link
Member

The current YAML setup is pretty fragile and can be confusing (e.g. when to make a map or a list).
With all the potential options coming up in the Supporting/Neural models, we need a configuration that is more robust.
A JSON setup would be pretty nice.

We should make a JSON format and deprecate the YAML format in the next release.

@eriq-augustine
Copy link
Member Author

Here is a draft of the proposed format:
https://docs.google.com/document/d/1Xz5qX8rL_nlx3r7peKkeTX5vvRBbtdWmlmAZQtLHafw/edit?usp=sharing

This has been expended to include more than just config, but also rules, and general PSL config.

@eriq-augustine eriq-augustine changed the title JSON Data Description Files JSON PSL Config Aug 16, 2022
@eriq-augustine eriq-augustine changed the title JSON PSL Config JSON PSL/Runtime Config Aug 16, 2022
@mhm90
Copy link

mhm90 commented Aug 16, 2022

The single JSON for everything configuration is pretty good idea, specially when someone wants to run PSL CLI from his code or other process, but my experiences showed me that it lacks of human readability/writablity as it has many rules for a JSON text to be valid. There is also lack of comments in a standard way and it makes it worse. I believe you can still use YAML for handling List and Map. Also there is nothing better than XML for your needs.

@eriq-augustine
Copy link
Member Author

YAML is out, we are generally not fans and the subtle differences between list and maps have made it hard on our users.
XML is out, it is way too verbose and not human-readable enough.
There are plenty of JSON libraries that will allow comments (and allow for more flexible syntax (like trailing commas)).

@mhm90
Copy link

mhm90 commented Aug 17, 2022

I still insist on using YAML because it has less syntax stuff and fewer special characters and it is only using whitespace for distinction which makes it more readable. You can simply handle Map as described in https://www.baeldung.com/yaml-map-pojo and the differences between a Map and a List is pretty obvious:
A List is in this form:

yamlconfig:
  list:
    - item1
    - item2
    - item3
    - item4

while a Map is like:

yamlconfig:
  map:
    key1: value1
    key2: value2
    key3: value3
    key4: value

There are plenty of JSON libraries that will allow comments

I usually don't use things that are not implemented according to standards since they are fragile and may change soon. Also, these implementations usually have no good community for maintaining them.

@eriq-augustine
Copy link
Member Author

We will still support YAML, but all our descriptions, examples, and efforts will be in JSON going forward.
Any YAML config will be directly converted to JSON and worked with in that form.

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