Hacker News new | ask | show | jobs
by manjana 2629 days ago
What's the benefit using k vs. c, cpp or java for the same? Does it run or compile faster?

The article says you can do the same with cpp and some extra libraries, but I wouldn't immediately think cpp or java was easily beatable -- manjana wonders --

4 comments

K is interpreted, not compiled. You can run your code the instant it's written.

As other's have said, K (the language and the interpreter) is highly optimized for processing tabular data. I've heard of it outperforming C in processing billions of rows of financial data. (Which, by my understanding, is K's primary market.)

Lastly, K (like APL, J, A+, Klong, Kona, etc.) is very terse. A phrase I've seen online is "one line of K is roughly equivalent to 100 lines of C". K programs, like APL & co., very often fit entirely into a screenful of text, but require close and complete reading to understand. There are lots of videos on youtube of people writing literate sudoku solvers or conway's game of life in a dozen lines or so, and terse solutions in a dozen or so characters.

People who like these programming languages tend to like their terseness -- they can view the entire program all at once (no scrolling or searching), and refactor or rewrite the program in a few seconds of minutes of typing.

If you would prefer to use keywords instead of symbols, Nial is a good option: https://github.com/danlm/QNial7
If I understand you correctly, why use K over another language like Java? Java is a good enterprise language, but K is a good analysis language. It is very terse and powerful. Look up Kdb+.
It depends on what you're doing. If you wanted to analyze some tabular data, k, sql, or even excel are probably more appropriate than c++ or java.
If your problem fits it you can solve it with a fraction of code. It also runs extremely fast and apart from licencing it's trivial to deploy.