• themoonisacheese@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        15 hours ago

        Okay so basically this is saving bytes on a technicality but also good programming language design (for this specific purpose).

        The first aspect is that since you’re scored on bytes, it’s not really to your advantage to use a language that uses ascii (or utf-8) for it’s tokens, because a large part of it is unprintables like DEL or BELL. So people have designed specially crafted golfing programming languages that use a full 256 possible characters in order to pack as many features as possible in as few bytes as possible.

        The good design part of it is that if you really think about it hard, there’s really not that many things you expect a programming language to do. It turns out that 256 total different operands is about in the sweet spot, so each character that’s available in the 1-byte code page is mapped to one command, and the languages are also designed to make as many things as possible implicit, both at the cost of readability. Remember, all that matters here is getting the lowest score, not code maintainability or anything else.

        This leads to languages like japt (which is a terse form of JavaScript, I’m pretty sure) or pyth (same for python) or Vyxal (my personal favorite, used to be python based but is now bespoke) that look like this but absolutely own at getting a task out in as few bytes as possible.