Live data from Hacker News

Kibi – A text editor in less than 1024 lines of code, written in Rust

terminaltrove.com

1–10 of 10 posts

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#3

  /tmp/kibi % cloc .
        98 text files.
        89 unique files.
        11 files ignored.

  github.com/AlDanial/cloc v 1.96  T=0.05 s (1936.6 files/s, 82405.1 lines/s)
  -------------------------------------------------------------------------------
  Language                     files          blank        comment           code
  -------------------------------------------------------------------------------
  Rust                            15            241            379           1480
  Markdown                         5            179             22            502
  INI                             50              3             20            388
  YAML                            10             36             21            281
  XML                              1              0              1             62
  TOML                             3             10              1             57
  Bourne Shell                     1             13              8             46
  JSON                             2              0              0             31
  Dockerfile                       1              2              0              3
  SVG                              1              0              0              1
  -------------------------------------------------------------------------------
  SUM:                            89            484            452           2851
  -------------------------------------------------------------------------------

I'm not sure if this counts as less than 1024.

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#4
post #3

/tmp/kibi % cloc . 98 text files. 89 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.96 T=0.05 s (1936.6 files/s, 82405.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 15 241 379 1480 Markdown 5 179 22 502 INI 50 3 20 388 YAML 10 36 21 281 XML 1…

[flagged]

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#5
post #3

/tmp/kibi % cloc . 98 text files. 89 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.96 T=0.05 s (1936.6 files/s, 82405.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 15 241 379 1480 Markdown 5 179 22 502 INI 50 3 20 388 YAML 10 36 21 281 XML 1…

There are some OS specific files (unix.rx, windows.rs, etc) that you can discount (imo).

If you really wanted to codegolf the repo, I'm sure you can make it literally <1024 lines.

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#6
post #3

/tmp/kibi % cloc . 98 text files. 89 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.96 T=0.05 s (1936.6 files/s, 82405.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 15 241 379 1480 Markdown 5 179 22 502 INI 50 3 20 388 YAML 10 36 21 281 XML 1…

Even though that's 400-ish over, the readme states:

   1.: Counted per platform, excluding tests and Clippy directives, see count_loc.sh

However, I personally feel like it's a stupid metric anyway because that doesn't count dependencies (although kibi specifically seems to have minimal dependencies), and at some point you could simply abstract your code away into a library and use it as a dependency to prune some lines from the codebase.

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#7
post #2

https://github.com/ilai-deutel/kibi the repo is here btw. i appreciate that the dependency tree is appropriately minimal. also impressive how many comments are included in the source. maybe they’re not counted towards the LOC?

Maybe the comments were written by another LLM. It certainly has that smell.

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#9
post #6
post #3

/tmp/kibi % cloc . 98 text files. 89 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.96 T=0.05 s (1936.6 files/s, 82405.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 15 241 379 1480 Markdown 5 179 22 502 INI 50 3 20 388 YAML 10 36 21 281 XML 1…

Even though that's 400-ish over, the readme states: 1.: Counted per platform, excluding tests and Clippy directives, see count_loc.sh However, I personally feel like it's a stupid metric anyway because that doesn't count dependencies (although kibi specifically seems to have minimal dependencies), and at some point you could simply abstract your code away into a library and use it as a dependency to prune some lines…

It also excludes tests, which is how they reach such a low number. It seems they are trying to count the number of lines actually used in the executable. I can't see the value in this metric. If they want to talk about executable size, they should just use that. If they want to talk about the complexity of maintaining their project, then surely you must count all lines because those still make the project harder to maintain. I guess they're trying to measure the logical complexity of the final result, but I can't for the life of me think why a user or developer would care about this.

Re: Kibi – A text editor in less than 1024 lines of code, written in Rust

#10
post #4
post #3

/tmp/kibi % cloc . 98 text files. 89 unique files. 11 files ignored. github.com/AlDanial/cloc v 1.96 T=0.05 s (1936.6 files/s, 82405.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Rust 15 241 379 1480 Markdown 5 179 22 502 INI 50 3 20 388 YAML 10 36 21 281 XML 1…

[flagged]

hehe, for some reason "written in rust" is becoming a trademark