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

RFC: Replace CYON with JSON5 #78

Open
VisenDev opened this issue Jan 13, 2024 · 1 comment
Open

RFC: Replace CYON with JSON5 #78

VisenDev opened this issue Jan 13, 2024 · 1 comment

Comments

@VisenDev
Copy link

VisenDev commented Jan 13, 2024

Hello,
I'd like to request information on why Cyber Object Notation was chosen as the serialization/deserialization format for this language.

As it seems the syntax is quite similar to JSON5, i'd like to discuss whether it would be better to use this more widely supported language instead.

This example in CYON

[
    name: 'John Doe',
    'age': 25,
    -- This is a comment
    cities: [
        'New York',
        'San Francisco',
        'Tokyo',
    ],
]

Would look like this in JSON5

{
    name: 'John Doe',
    'age': 25,
    // This is a comment
    cities: [
        'New York',
        'San Francisco',
        'Tokyo',
    ],
}

As you can see, it allows for almost identical syntax. While having the benefit of being a more common format that will be more accessible. (For example, as show above, JSON5 is common enough that github has syntax highlighting for it)

This isn't meant to be a criticism of the design of CYON, or say anything about whether its syntax is good or bad.

@fubark
Copy link
Owner

fubark commented Jan 14, 2024

Right now they are similar but having our own format allows us to extend it further later on.

I'm not against supporting JSON5 though. Ideally it would be a third-party package that you can just import from a URL but since Cyber is in its infancy it could simply go into a builtin "x" module like in Golang. Essentially a temporary module for useful utilities that early adopters might find convenient.

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

2 participants