Hacker News new | past | comments | ask | show | jobs | submit login

Where did the author get the idea that fish is 200k SLOC? They're wildly mis-counting.

Yes, `cloc` on a fresh checkout of fish-shell says there's 200k lines, but most of that isn't fish-shell source. Fully half of that is from PCRE. And if I run `cloc` on just the `src` directory I get 39k lines.




Q: Where did the author get the idea that fish is 200k SLOC?

A: 'cloc' on a fresh checkout of fish-shell says there's 200k lines.

;)


No matter how many of these lines you label as "fish" and "not-fish", they somehow all end up in "/usr/bin/fish".


Well, not necessarily. The linker will strip out any symbols that aren't actually used, which may indeed be a non-inconsequential chunk of fish's bundled dependencies.


That's not particularly meaningful. The author was making a statement about shell complexity by using lines of code, not making a statement about binary size. The fact that there's 113k CLOC of PCRE in there is pretty irrelevant to talking about the complexity of Fish itself.


Author here :) - I did all of the counts using the source tree (from tarball or cvs) of the respective shells.

Using just the `src` tree doesn't cut it imo, especially for fish, it installs lots of python scripts (fish_configure which sets up a python webserver, fish_update_completions which calls create_manpage_completions.py.. etc). Those count, and they are not included inthe src tree.


`cloc` on the `share` folder (which contains all of the python webserver scripts) only adds another 10k. Also I'm not sure those should count when talking about shell complexity, because nearly all of that is strictly a helper tool that most people don't actually even run (fish_config), so isn't particularly meaningful for your day-to-day running of the shell.

Or to put it another way, running `cloc` on the full checkout is extremely misleading. You're counting PCRE and other stuff that aren't particularly relevant to talking about shell complexity. Find the specific folders you do care about (which I still maintain is just the src/ folder) and run `cloc` on those specific folders, not on the full checkout.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: