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

Formal definition of CSON #38

Closed
hildjj opened this issue Mar 31, 2014 · 7 comments
Closed

Formal definition of CSON #38

hildjj opened this issue Mar 31, 2014 · 7 comments

Comments

@hildjj
Copy link

hildjj commented Mar 31, 2014

JSON suffered from being too tied to the JavaScript programming language early on. I suggest a document describing the format being parsed, so that other interoperable implementations can be built.

If this exists already, than I suggest a link in the README. If it doesn't, I'd be willing to take a first stab at text.

@RobLoach
Copy link
Contributor

Some other specification definition examples for other structured data:

@hildjj
Copy link
Author

hildjj commented Mar 31, 2014

Another example: RFC7159

I'd suggest that there are two paths.

  1. Document a subset of CoffeeScript that maps 1-1 with JSON, including specifying the mappings
  2. Define a completely separate syntax that avoids some of the interop challenges JSON faces at the edges (search RFC7159 for "interop")

Of these, I think I prefer (1), but not by much.

@RobLoach
Copy link
Contributor

http://coffeescript.org/#objects_and_arrays

Maybe this goes beyond just CSON, but CoffeeScript definition in general.

@hildjj
Copy link
Author

hildjj commented Mar 31, 2014

Experience from JSON tends to indicate that divorcing CSON from coffee-script as soon as possible is going to allow much better interop between CSON implementations written in different languages. If coffee-script needs a more formal definition, that's an unrelated issue. The language at http://coffeescript.org/#objects_and_arrays is a good starting point, of course.

@balupton
Copy link
Member

balupton commented Feb 6, 2015

Fixed in v2 - there is now cson-parser package

@balupton balupton closed this as completed Feb 6, 2015
@hildjj
Copy link
Author

hildjj commented Feb 6, 2015

Although I agree that splitting out the parser code into a separate module that doesn't re-use the coffee-script parser was fantastic work, I think you may be missing the point of the documentation request. Defining CSON as a wire-level protocol (where the "wire" might include a file, for example) is necessary if I want to write an implementation in a language that doesn't share ECMAscript's odd notion of Unicode (UTF-16 plus naked surrogates with escape sequences that might or might not generate valid Unicode when parsed?), have different notions of numbers (e.g. real 64-bit integers), has floating point types that work, etc. Saying "it's just coffee-script, and therefore just ECMAscript" doesn't make these questions go away. Am I allowed to include functions? Can I include function calls? What about using "import"?

@balupton
Copy link
Member

balupton commented Feb 6, 2015

No dynamic abilities. They are for coffee files. CSON is now just a data format. Further discussion should happen over at https://github.com/groupon/cson-parser see #33 also

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

3 participants