Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    K       +/!100
    Python  sum(range(100))
    Haskell sum [0..99]
    Rust    (0..100).sum()
    Ruby    (0..99).sum
There are plenty of ultra-concise languages for toy problems like these; they are called ‘golfing languages’. Ultimately it's a bit pointless since most of the time people aren't playing code golf.

(The issue with setting everything to obscure ultra-compressed keywords isn't that it's not possible to learn those keywords, but that most of the time programming is done over specific and customized domains with larger and problem-specific vocabularies.)



Except in K all the idioms are laid flat. As pointed out in the article, the K code is the equivalent of range(100).reduce(operator.add), it encapsulates the entire meaning, there is no need for an intermediate function definition because that would be longer than the code itself.


Well I guess I agree with this statement, except that I don't think K is primarily used for solving toy problems.


That's what I'm wondering with K! What happens once I want to abstract over the basic operations?


The article's point is a meta-point. Congratulations on actually being part of the meme in the article.


The article's point is dishonest smugassery. Congratulations on convincing people to avoid K for its community, if not the language itself.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: