3 ms·
`cat` without any options support is possibly simpler than left-pad. I think the big difference is that very few people set their systems to trust and receive
by AgentME 8y ago
`cat` without any options support is possibly simpler than left-pad.
I think the big difference is that very few people set their systems to trust and receive updates of `cat` directly from the developers of `cat` (and same for all the other standard tiny utilities). Instead, they rely on a Linux distribution to vet the developers' code and to regularly pull in updates. Maybe there's room for a similar model of distributions vetting code in the npm ecosystem.
- bmurphy1976 8y agoDo you really think cat is as simple as left-pad? https://github.com/freebsd/freebsd/blob/master/bin/cat/cat.c https://github.com/freebsd/freebsd/blob/master/bin/cat/cat.c Also, cat is kind of an important primitive for building a functional system that uses files as one of its core abstractions. It makes total sense that it would (a) exist and (b) be well maintained by an authoritative and reliable source. Left pad it is not.
- marshray 8y ago> `cat` without any options Interestingly, the `raw_cat()` function is 37 lines long. https://github.com/freebsd/freebsd/blob/e511976db9f51bae1a5986e1f1d7653d8f31fbae/bin/cat/cat.c#L299 https://github.com/freebsd/freebsd/blob/e511976db9f51bae1a59...
- kps 8y agoUNIX `cat`, unchanged from V2 through V6 until it was rewritten in V7, was 44 instructions.
- slavik81 8y agoThe core utilities are provided as a suite. The cat utility is one of a hundred others, all packaged together. Even without distributions, you'd only need to vet one organization for those basic utilities.