Menu

#1 Is there an attempt to use PON in other languages?

unread
nobody
None
major
proposal
2020-01-23
2020-01-23
No

This was a hit when I checked the unique data description format by looking at JSON or TOML in the concept of a tool created by Python.

I think the concept of Python version JSON is interesting.

However, I think if you try it in languages ​​other than Python as well as JSON which was the basis of PON.

(originally posted on 2019-06-08 at 05:18:38 by 鳶市 奎 刀香/keito940 <keito940@bitbucket>)

Discussion

  • Anthon van der Neut

    No there is no such attempt. The main thing to have something more powerful than JSON and more readable than TOML is to have something that is valid Python, so it can be embedded in e.g. ``__init__.py`` and loaded from there to having to exec() something, and without having some non-standard dependency.

    That obviously is not going to be useful for anything but Python or something that is some large subset of Python.

    If you want to exchange PON data with some other language, then I would consider converting to YAML first. JSON and TOML are not powerfull enough to do that.

    It would IMO make sense to have a standard YAML conversion for PON, including tags for non-evaluated arithmetic etc.

    (originally posted on 2019-06-08 at 10:19:07)

     
  • Anthon van der Neut

    The answer I came up with was thinking of incorporating the Python processing system into the software that you want to use the PON file, and reading the PON file with the Python processing system that incorporates it.

    If it can only be read in Python, it will be executed with the same idea as a Python script.

    (originally posted on 2019-06-08 at 10:51:52 by 鳶市 奎 刀香/keito940 <keito940@bitbucket>)

     
  • Anthon van der Neut

    If you include the python runtime into another language, you still need to do quite some work to get information from the data structure that Python creates from PON to something native to the host language.

    Please also note that PON is evaluated, not executed. Executing runs the risk of unwanted code being run, the evaluation of the same input will result in an syntax error during evaluation.

    (originally posted on 2019-06-08 at 16:41:44)

     
  • Anthon van der Neut

    In other words, bother Is it easier to convert to YAML compatible with PON than to incorporate Python?

    …But is it better to make a subset of PON that is not related to Python?

    (originally posted on 2019-06-09 at 02:06:31 by 鳶市 奎 刀香/keito940 <keito940@bitbucket>)

     

Log in to post a comment.

MongoDB Logo MongoDB