4 ms·
I wanna know which language port has the fewer lines of code.
by ky738 10y ago
I wanna know which language port has the fewer lines of code.
- ue_ 10y agoGoing by my preconceived notions, I thought Perl 6 or elisp. I think in fact Perl 6 is shorter.
- ballpark 10y agoThat's a good question. I didn't make an effort to compare them, but it seems like it would be Racket because writing DSLs seems to be Racket's specialty, plus it's already a lisp.
- deleted 10y ago[deleted]
- hvnsweeting 10y agoUsed my python package dwc(https://github.com/hvnsweeting/dwc https://github.com/hvnsweeting/dwc) dwc */ | sort -n | head 494: examples/ 846: docs/ 1268: mal/ 1464: perl6/ 1483: coffee/ 1509: io/ 1534: racket/ 1571: ocaml/ 1579: es6/ 1621: factor/ Edit1: for better command Edit2: for formatting
- kanaka 10y agoThe problem with that command is that it also counts the Makefile, Dockerfile and other supporting files. It also counts every implementation step (so lots of repeats in the LOC). However, each implementation does have a "stats" rule. So the following command at the top-level can be used to a get a nice summary: for i in $(make print-IMPLS); do \ s=$(make stats^$i | grep total); \ printf "%-9s %s\n" "$i" "$s"; \ done | sort -n -k2 I made a gist with the current results: https://gist.github.com/kanaka/fdef20f5d0c2e04b97d9106b2f2f23d0 https://gist.github.com/kanaka/fdef20f5d0c2e04b97d9106b2f2f2...
- behnamoh 10y agoI compared the CORE file for the following, Ruby seemed to be more succinct: Haskell, Ruby, Kotlin, Lua, Go, Rust, C, Swift.
- kanaka 10y agoI made a quick gist of the current LOC/file size stats: https://gist.github.com/kanaka/fdef20f5d0c2e04b97d9106b2f2f23d0 https://gist.github.com/kanaka/fdef20f5d0c2e04b97d9106b2f2f2... Note that this should obviously be taken with a grain of salt: the implementations were created by many different people each with their own style and differing experience levels with the target language. That being said, from my own experience, I think the concision (size) of the implementation often reflects how "Lispy" a language is. Most of the Lisps are in the top half of the list (fewest LOCs). Ruby is often described as very Lisp-like. Factor is one that stands out for me (second after mal itself). Factor also happens to be one of the fastest implementations (for certain microbenchmarks).