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?

  • themoonisacheese@sh.itjust.works
    link
    fedilink
    arrow-up
    50
    ·
    1 year ago

    Pretty much all programming languages in use today have been invented decades after the keyboard.

    The keyboard was originally invented for typewriters, but since they don’t interact with anything and are self-contained systems, typewriters don’t need their keys standardized. However, the keyboard converged as HP, Brother et al. brought the typewriter forward, especially near the end when typewriters were keyboards connected to printers.

    Early computers weren’t programmed with keyboards at all and used punch cards to be programmed. As you move forwards with the invention of the computer as we know it today, you find out that the modern keyboard was invented to be able to type most characters in use at the time (a classic example is that the @ sign was used by tellers on tills, to mark stuff like 2 units @ $5 per), and actual standards body such as iso and ANSI simply implemented that.

    Early personal computers were not powerful enough to compile programs quickly(and compilers were very expensive), so for a while all programming was done either in assembly, which requires very few special characters, or in higher lever languages by people who could pay to get their programs compiled. These higher lever languages, such as B (precursor to C), were often written right on paper by hand, or by typewriter. After this point, home compilers became more and more accessible (the internet basically guaranteed you could get a compiler if needed), and this was the last point in history you could design a language with characters not present on a standard keyboard (you could still have a nonstandard typewriter, or write them by hand for example). After this and the explosion of home computing, people designed their own languages that they were able to use themselves, using their own keyboards.

    Worth noting that there exist languages today that you cannot type, pretty much at all. They are however largely considered esolangs (esoteric languages) and most of their use is relegated to the practice of code-golf, in which a programmer tries to accomplish a task using the fewest bytes. Since the characters on a keyboard make up a fraction of all characters available in Unicode or even just ASCII, these languages try to increase the number of things you can do with a single characters by disregarding the fact you can’t type most of them, lowering the amount of bytes one needs to do a task.

    An example of this is O5AB1E (pronounced “osable”), which has over 250 single-character commands, such as Δ which “repeats code until ‘a’ doesn’t change”.

    An example (that you can’t type) is: yā<ã.Δ¹sŸèOQ

    This program gets an input n and a string of numbers, then outputs the first run in the string that sums to n. The program is explained here

  • Turun@feddit.de
    link
    fedilink
    arrow-up
    17
    ·
    1 year ago

    Not only do the Languages orient themselves to fit to the keyboard, they pretty much only consider the English keyboard layout.

  • OOFshoot@beehaw.org
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    Programming languages are build around the standard keyboard. Keyboards had most of the symbols you’re thinking of from their typewriter days. You can see most of the special characters in these small typewriters from the mid 1900s.

    https://dealdashreviewed.com/wp-content/uploads/2015/02/typerwriter.jpg

    https://3.bp.blogspot.com/-gdj1kOXgkTY/UqYxNGAxBBI/AAAAAAAA8T0/DTeg3C_ydXM/s1600/71-6zsvcleL._SL1500_.jpg

    With things like electric Wheel Writer typewriters, adding extra keys and symbols were less of a complexity issue and you started to see a few more extra symbols.

    https://www.imagine41.com/wp-content/uploads/2016/07/ibm_wheelwriter_2500_002_1.jpg

    Recognize that there never has been a hard standard for layouts and symbols, just the industry copying and converging on systems that became popular.

  • jflorez@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    Modern keyboards are an evolution of the old typewriter that existed before computers as we know them and programming as we know it existed, so I would say keyboard came first

  • Die4Ever@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 year ago

    I won’t consider any keyboard to be designed for programming unless it has dedicated keys for characters like {}() &lt; >_+| &amp; !*:" without needing to hold shift for them (Lemmy seems to be improperly escaping my less-than sign and ampersand)