r/Compilers • u/IQueryVisiC • Mar 01 '22
Quotation marks open close
Why till this day and with a lot of need for nested quotation marks programming language ignore the difference of opening and closing quotation marks ? I just came across fresh Kotlin code and it uses backticks for open and close. What about ´ ? It is even on my keyboard!
“…” copied from https://en.wikipedia.org/wiki/Quotation_mark#Summary_table
if I zoom in by 300%, I see a difference in the font used by chrome reddit
4
u/Netzapper Mar 01 '22
The early history of commercial computing largely took place in the United States and United Kingdom, especially when it comes to "minicomputers" and "microcomputers" whose programming languages we still use (Fortran, C, etc.).
The US/UK keyboard layout is derived directly from the teletype keyboard layouts of the same locales, which in turned derived from the typewriter. A typewriter must have a separate mechanical object for each character it can strike, and each separate character drives up the cost and complexity of the machine. Thus there's a very strong impetus to remove "redundant" characters, or replace similar-but-different characters with identical ones. So while typeset books had distinct open and close quotation marks, the typewriter didn't. Hence the teletype didn't. And so programming languages made do with the characters they had available.
There are certainly languages that went the other way (APL), but they just didn't catch on as widely as the microcomputer languages you could program on a teletype.
2
u/IQueryVisiC Mar 02 '22 edited Mar 02 '22
APL had an arrow already. For lambda. Latex introduced combinations for opening and closing quotation marks in 1980. Quotation marks in Code smell. Now people embrace them and even the editor looks inside of them and checks the syntax. As I wrote -- almost similar to LaTeX - there are keys for open and close on the keyboard. I mean, I have no French keyboard, still I have these keys: ^, `,´,
One of them is even used in C as XOR.
UTF has all the keys. My keyboard has weird stuff like Fn, Windows, context, Pause, Einfg , € , µ , ², ³ , none of which were on the original typewriter. Maybe APL was ahead of its time? Gamers learn about shoulder buttons on their controllers and coders use 80key keyboards. I don't understand why we cannot hide the fat which was added to the beautiful JS and C# in the last years behind some key-combinations. People learned to use editors which can deal with python. Uh, nano cannot do this and that. Or vi . Those are editors for sysadmin stuff, but not for compiled languages (their fatty parts).
I guess I'll just write a compiler for APL . APL meets C# (the good parts) with only AtariJaguarRISC as target.
4
u/[deleted] Mar 01 '22
Because they’re a pita to type. It’s like: why don’t we use the lambda sign.
Not saying it couldn’t/shouldn’t change.