Fork me on GitHub
#clojure
<
2020-01-01
>
craftybones10:01:28

I’m running an experiment and I want to count the number of lines of code taken for a program across several languages. I also want to see if I can count the bytes of the same solution “minified”. How would I approach this? I looked at existing linters to see if I can do something like this. I tried using read but I wanted to check if there is already something I could potentially use

Probie10:01:40

@srijayanth not directly related to your question, but I'm curious about your methodology. Will you include the source for the standard library (or any other libraries used) for a language?

craftybones10:01:02

No. I thought of it, but that’s a rabbit hole I want to avoid initially. If I get this done, I’ll certainly extend it maybe

craftybones10:01:29

Maybe I should just use clojure.tools.reader and spit it out myself…

craftybones10:01:03

@ludvikgalois - I will initially stick to programs that don’t need help other than the standard library

seancorfield17:01:33

@srijayanth If you're on macOS/Linux, why not just wc -l to get the line count?

craftybones18:01:26

@seancorfield - I will get the line count, but I also want to run a minifier on each of them to see what I get.

rakyi18:01:51

there is also https://github.com/XAMPPRocky/tokei which should be faster

rjray18:01:55

Yes, wc counts lines, words (based on whitespace separation) and total characters.