• FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    2 months ago

    Very cool. To be honest most of these languages (except maybe Lisp and BASIC) are pretty awful. I can’t imagine writing anything in them. Especially K. That’s got to result from some form of brain damage…

    It’s only 7 bytes of code. !10 returns a list of numbers 0 to 9. 1+!10 adds 1 to each of them resulting in a list [1, 2, …, 10]. Finally /1+!10 applies * verb with scan adverb and returns 123…*10 which is a factorial of 10.

    But it processes arrays of numbers in such an elegant way what no other language can compete with it (well, maybe numpy).

    Uhm yeah or maybe MATLAB? I mean I mainly like MATLAB because of its unbeatable plotting abilities, but even MATLAB can do prod(1:10). I am very happy to spend 3 extra bytes on that readability improvement!