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

Yes, but as you multiply that difference 100x or 1000x, the advantages of the concise notation become obvious.



This 100 or 1000x claim is extraordinary. Do you have any factual basis for repeatedly asserting it?


Contrived Debian shootout benchmarks:

http://www.kparc.com/z/comp.k

https://web.archive.org/web/http://shootout.alioth.debian.or...

Note that the relevant k program here is contained entirely on the last line of code and denoted by a comment telling you what it does:

http://www.kparc.com/z/fun.k

http://c2.com/cgi-bin/wiki?WardNumberInManyProgrammingLangua...

Most Joy people are also k people, and Joy appears to be the only one similar, although still very large.

The C++ program is lost to link rot now, but by the author's own admission, was substantially larger than even the substantially large examples within that page.

      1    2   29 k
     23   70  498 scheme
     25  111  768 otherhaskell
     44  135 1096 erlang
     53  125 1043 rb
     67  190 1419 ocaml
     74  346 1693 haskell
     80  357 2586 java
Keep in mind that by their own admission, everyone in the c2 thread's code was hard to read (outside of the Joy program), and many were buggy. Meanwhile, the k program is quite simple to read.

These are just some basic examples, though.


You should probably label your columns, but that seems to be wc output.

The Scheme and Haskell versions are actually shorter than you imply since they include the pairings in the count (when the pairings in the code are examples). Additionally, the k version is one line longer than you suggest. The definition of a is on its own line is used in the solution. Still only 2 lines, but if you want to persuade you should probably have correct numbers.


Fair crit! Running off of few hours of sleep last night (spent way too long defending k in this thread; need to set sensible noprocrast settings or get some flavor of self-control); accuracy is impaired. Another error I see in retrospect is that I included comments in a few of them but not all of them.


So maybe 40x in line count if you compare an extremely verbose language like Java to K in this contrived example? That's not close to 100x and especially not close to 1000x.


I'm sorry, but which one are you looking at? (All comments stripped:)

k mandelbrot line count: 1

c++ mandelbrot line count: 148

Java line count: 157

Modern PL example (found on the modern shootout page, which I just found out they changed the link on):

Rust mandelbrot line count: 116

Ada mandelbrot line count: 532

And that's not even the one where k comes off the best.




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

Search: