← Back to context

Comment by hoosieree

1 year ago

I started with J but now prefer K and I'm writing an interpreter for a K-like language in my spare time for fun.

I'd say the minimal syntax isn't just a gimmick, because it really does help with mentally chunking phrases/idioms to a degree that's not possible when the same phrases are multiple lines long. Terseness also makes it physically faster to write the same thing, which encourages interactive experimentation much more than other languages.

These are small things, but taken together you get an experience that's more than the sum of its parts.

A lot of folks seem to tolerate K syntax because K jobs pay well. (Supposedly. I've never seen a super-high paying K job in real life.) But I actually like the K syntax because it helps organize my problem solving, and it gets out of the way during experimentation time. To me it's like NumPy/Pandas but better designed and without all the ceremonial boilerplate.

Would an array language without the terseness, but with hygienic macros, fit the same niche?

  • I don't see how it could, the terseness is the point. I'm not sure how a macro system could really help. Did you have a specific idea in mind?

    • The thought was - if I have a long piece of code repeated, and I want it to be shorter, I can

      - Use a language that minimizes the code to write

      - Use a helper function, maybe at some runtime cost

      - Use a macro, turning a short piece of code into a longer one, at a compile-time cost

      Having a DTI (debt-to-income ratio) macro and a very short definition of DTI that looks similar everywhere in code sort of do the same thing.