The title would probably be confusing, but I could not make it better than this. I noticed that most programming languages are limited to the alphanumerical set along with the special characters present in a general keyboard. I wondered if this posed a barrier for developers on what characters they were limited to program in, or if it was intentional from the start that these keys would be the most optimal characters for a program to be coded in by a human and was later adopted as a standard for every user. Basically, are the modern keyboards built around programming languages or are programming languages built around these keyboards?

  • fubo@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    edit-2
    1 year ago

    C supports alternate ways of typing some of its punctuation, for programmers whose keyboards didn’t support them all. For example, if you can’t type [ ] you can use ??( ??) instead. (There are other ones that use angle brackets, but I can’t type them here because Lemmy escapes them incorrectly. Irony.)

    https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C


    The usual example of a programming language using especially unusual characters is APL, where all built-in functions are all represented by single characters, mostly drawn from mathematical notations, Greek alphabet, and so on. For example, is the “sort” function.

    • cwagner@lemmy.cwagner.me
      link
      fedilink
      arrow-up
      19
      ·
      edit-2
      1 year ago

      APL

      From one of the many How to shoot yourself in the foot guides, for APL:

      • You shoot yourself in the foot; then spend all day figuring out how to do it in fewer characters.
      • You hear a gunshot and there’s a hole in your foot, but you don’t remember enough linear algebra to understand what happened.
      • @#&$%&% foot

      A fascinating language to look at, Conway’s Game of Life is simply life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}, but I have zero interest in ever actually learning it ;)

      There are also keyboards with the proper symbols: