4 ms·
> I feel open parsing files is misguided. Downright wrong if it profilerates into scripts, because suddenly simple scripts can't work on JSON, because opening J
by dragonwriter 7y ago
> I feel open parsing files is misguided. Downright wrong if it profilerates into scripts, because suddenly simple scripts can't work on JSON, because opening JSON returns something different from a stream of lines.
Doesn't “open --raw” address that?
https://book.nushell.sh/en/loading_data#opening-in-raw-mode https://book.nushell.sh/en/loading_data#opening-in-raw-mode
Also, I suspect most simple scripts that want to work on JSON Will want to parse it, so the default makes them more easily able to work with it, not less.
- lostmsu 7y agoI am having a problem with --raw not being default. Defaults must be secure and stable.
- mkl 7y agoCan you explain why parsing JSON can't be secure or stable?
- lostmsu 7y agoThe problem is not with JSON parsing. It is with the fact, that people will use open without --raw to process, for example, Python files, because it is easy and works now. And some day later shell will learn to parse them into AST with open, and today's scripts will no longer work. Or worse start doing something very wrong.