cson-parser icon indicating copy to clipboard operation
cson-parser copied to clipboard

Implement clean parser

Open jkrems opened this issue 10 years ago • 9 comments

Right now we are using CSR for parsing which handles a huge superset of the files we'd want to parse. We should consider implementing a clean parser for CSON as part of this repo.

jkrems avatar Oct 06 '14 21:10 jkrems

cc @abloom @mcculloughsean - on a scale of 1-10: How stupid is this idea?

jkrems avatar Oct 06 '14 21:10 jkrems

For what benefit? Why would we want to strip it?

abloom avatar Oct 06 '14 21:10 abloom

├─┬ [email protected]
│ ├── [email protected] (git://github.com/michaelficarra/cscodegen.git#73fd7202ac086c26f18c9d56f025b18b3c6f5383)
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]

Pretty much 100% of that is not used by us. But somebody who wants to parse CSON files will have to download all of it. And there's the point that CSR is in eternal beta and seems all but abandoned.

jkrems avatar Oct 06 '14 21:10 jkrems

I mean, it sounds like a fine idea, but it sounds like a bunch of work that's only benefit is to make the download smaller? Is there a performance improvement?

abloom avatar Oct 06 '14 22:10 abloom

I wouldn't expect a serious performance improvement (it's not doing that much more). But it would cut the installed size of this package in half and help defining what exactly valid CSON is (without referring to CSR implementation details). I'm not sure the initial implementation is really worth it, but it might be a fun weekend project at some point.

jkrems avatar Oct 06 '14 22:10 jkrems

It would be pretty neat if it didn't choke on legal coffee-script literals that cs-redux hates on, such as

{ "comma": "first"
, "basic": "json"
}

johan avatar Oct 07 '14 23:10 johan

@johan Since you know my hate for comma-first I'm sure you know that this is unlikely to make the cut if I'd be writing the parser... ;)

jkrems avatar Oct 07 '14 23:10 jkrems

I thought it was Sean McCullough who was the comma-first hater. :-)

johan avatar Oct 07 '14 23:10 johan

:+1: to a clean implementation without a CSR dependency

mcculloughsean avatar Oct 07 '14 23:10 mcculloughsean