top | item 23256756

X

896 points| boffinism | 5 years ago |xkcd.com

128 comments

order
[+] mkl|5 years ago|reply
Even without technically changing font, there are more than you might expect: XxˣₓẊẋẌẍⅩⅹ⠭ꭖꭗꭘꭙ🄧⒳ⓍⓧXx𝐗𝐱𝑋𝑥𝑿𝒙𝓍𝓧𝔁𝔛𝔵𝕏𝕩𝖃𝖝𝖷𝗑𝗫𝘅𝘟𝘹𝙓𝙭𝚇𝚡🅇🅧🆇

https://unicode-table.com/en/blocks/mathematical-alphanumeri...

[+] qubex|5 years ago|reply
I think that violates the “only X, but in different fonts” dictum. Those are technically different glyphs and therefore very distinct names. A font would be the same character tagged in different ways, those are absolutely different characters. Aside from the visual similarity, a computer would never be confused into think they’re even remotely similar (kind of how to us 1000000001 and 10000000001 look almost indistinguishably similar, but are almost impossible for a computer to confuse).
[+] bufferoverflow|5 years ago|reply
I never understood why Unicode has bold versions of characters, that's the function of the font, not the character set.
[+] lifthrasiir|5 years ago|reply
If you think that it is just a sick joke, take a look at this and think again: http://www.zifyoip.com/wysiscript/sigbovik.html
[+] vinniejames|5 years ago|reply
"Since each variable has a corresponding color, assignment is easily represented with background colors. For instance, A denotes the assignment of the number 12345⅔ to the variable #F00BA2. Note that this could also be written as rm -rf /, because we are removing the arbitrary indirect association between text and meaning to focus only on the clear meaning conveyed by the formatting."
[+] bisRepetita|5 years ago|reply
The paper's date is March 31st, so that it can be read on April 1st....
[+] norrius|5 years ago|reply
I am disappointed that the references at the end are made up and are not the prior art in the obviously important field of non-textual languages. I'd really love to learn about that "system for aromatic computation and its applications in cheese production [7]"!
[+] taneq|5 years ago|reply
Are you suggesting that this paper is in earnest? O.o
[+] aasasd|5 years ago|reply
Can't trust anyone who uses wall-to-wall justification.
[+] neves|5 years ago|reply
Nothing new here. I've see programmers that basically use x for everything
[+] weinzierl|5 years ago|reply
Back in the late nineties I worked with a software called Origin. It had a BASIC like programming language where variable names consisted of single letters. If you now think 26 variable names should be enough: Some of the letters, like X and Y, had special predefined meaning and you couldn't change that. If you used seem you encountered strange behaviour, like values changing behind your back. To add insult to injury I could never find documentation about which variables were special, so I stuck with the few I new were safe, which were not many...
[+] codeulike|5 years ago|reply
Like registers in a processor. e.g. the ARM1 had 16 32-bit registers, some of which were special (e.g. one was the pointer to the next instruction). From the point of view of a running program, those registers are the only true 'variables' that the processor had. Everything else was achieved by swapping them in and out of memory. I guess its the same for all processors. So a language with a restricted number of variables is actually pretty realistic - it represents the bare metal quite well.
[+] Starwatcher2001|5 years ago|reply
The old TRS-80 Model 1, Level 1 had 4KB of memory and the only permitted variables were integers (A-Z), and two strings A$ and B$. No decimals, floats etc.

Level 2 allowed any number of letters in a variable name... but only the first two were recognised as unique. CUSTORDER was seen as the same variable as CUSTLINE.

[+] dhosek|5 years ago|reply
There was a basic programming cartridge for the Atari 2600. It was limited to programs that could fit on a single low-res screen (I think six lines?) and only allowed one or two variables, if I recall correctly. I remember trying to write a simple program on a friend's Atari and found something that seemed really fundamental (maybe altering the value of an index variable in a for loop) was not allowed.
[+] filipn|5 years ago|reply
Reminds me of this comment from Reddit https://old.reddit.com/r/rust/comments/5penft/parallelizing_...

Go allows characters from the Canadian Aboriginal Syllabics for identifiers, so you can define structs or methods like this:

  type ImmutableTreeListᐸElementTᐳ struct { 
You can pretend that go has generics :)
[+] masklinn|5 years ago|reply
You're forgetting the important bit:

> That's just a "template" file, which I use search and replace in order to generate the three monomorphized go files.

They were using a separate codegen step (really just a sed run) to actually "do generics". In fact, that was the entire reason this thing was introduced[0], the structure originally used interface{} for its items.

The "generic" part was then moved to a `go_` file from which monomorphisations on bool, ArrayT and ScalarT got generated.

Also

> Go allows characters from the Canadian Aboriginal Syllabics for identifiers

I'd expect just about any language which supports unicode identifiers to allow this, as canadian aboriginal syllabics is a "normal" abugida, and its "textual" components are (properly) tagged as XID_Start and XID_Continue.

[0] https://github.com/google/enjarify/commit/55e8e65e681b15f026...

[+] 0-_-0|5 years ago|reply
Isn't that a syntax terror?
[+] sjagoe|5 years ago|reply
I think there is a design issue in that language. X in a fixed width font should be a constant. X in a variable width font is a variable.
[+] TopHand|5 years ago|reply
My Commodore Vic 20 running basic only allowed 2 character variable names.
[+] weinzierl|5 years ago|reply
That is not entirely true, from my recollection variable names could be longer but only two characters were significant.
[+] Tade0|5 years ago|reply
Unrelated question: what are the main reasons (aside from the obvious file format problems) for which we don't have rich text syntax?

Imagine having a e.g. link in the code. Wouldn't that be useful?

[+] cuspycode|5 years ago|reply
Algol-60 (and its younger cousin Algol-68) did actually use boldface to distinguish special keywords such as "if", "begin", "true", etc, from the namespace of ordinary identifiers. But that was only used in publications, not in machine-readable source code, since few encodings could support boldface. Instead various stropping[0] methods were used in the implementations of Algol. Today there is really no technical reason why rich text can't be used, but my guess is that syntax highlighting serves a similar purpose without complicating file formats and parsers.

[0]. https://en.wikipedia.org/wiki/Stropping_(syntax)

[+] virgilp|5 years ago|reply
> Wouldn't that be useful?

Useful - for what? Do you want that link to be written & maintained by you, or to be automatically generated by the tools? Because we already have the latter... (e.g. in many IDEs, ctrl-/cmd-click on symbols performs useful actions, eg. takes you to the definition or finds all references if you're at the definition site).

[+] _bxg1|5 years ago|reply
It's very hard to survey with precision the exact state of a body of rich text. I don't even like using rich text editors for prose, for this reason. HTML/Markdown are the closest thing we have to "rich text that's explicit and precise", but at that point you're back to plain text with special machine-readable syntaxes. And who wants to write out explicit formatting directives solely so that formatting can then drive program behavior?
[+] avianlyric|5 years ago|reply
I think debugging code is hard enough without having the debug errors cause by using the wrong font.

Have you ever wrestled with MS Word to make you heading appear on the right page? Imagine having to do that to make code compile.

[+] rootlocus|5 years ago|reply
Code already has all the information. It's enough for syntax highlighters, compilers, static analyzers, navigation, refactoring, etc.
[+] tomaskafka|5 years ago|reply
Swift has a markdown comments (starting with ///), which actually render formatting inside editor, and it's pretty great.
[+] aasasd|5 years ago|reply
> what are the main reasons

Terminals.

[+] js8|5 years ago|reply
I think this hits close to home. I wish creators of new programming languages would reuse syntax of existing programming languages (ideally the ones in the mainstream). Or at least think about it.

Also think if you even need a new language. It seems that too many new languages have features that can be handled by functions or macros in existing languages.

Some languages like Forth, Lisp or Haskell are very powerful, have strong metaprogramming facilities, and most likely can already do anything that would need a new language and new syntax.

Think about it - if you avoid creating another syntax variation, and work with an existing syntax (or better existing language), your chances of somebody actually using your efforts will vastly increase.

[+] giggly_gopher|5 years ago|reply
I heard a story that someone giving a talk at IAS only used M's on the chalkboard (lowercase, uppercase, doublestroke, script, etx) before he was told to cut it out. I can't remember who it was if anyone else heard the story.
[+] dodleptjdnd|5 years ago|reply
I had a class in grad school where the textbook ran out of english, greek, and hebrew letters and subscripts and resorted to serif vs sans fonts. It was interesting.
[+] emilecantin|5 years ago|reply
So, basically coding like a mathematician or physicist?
[+] bregma|5 years ago|reply
Came here thinking it was another jab at the venerable X11 display server. It seems we need a Unicode raster font to make this post more humourous.
[+] Wowfunhappy|5 years ago|reply
I am delighted to see an xkcd comic make it to Hacker News's front page, but also a little disappointed it happened to be this one. It's a perfectly fine comic, but there are so many others that could have engendered even more interesting discussions, which I'd love to have been able to read.

Limiting myself purely to more recent ones:

https://xkcd.com/2307/ - Alive or Not

https://xkcd.com/2224/ - Software Updates

https://xkcd.com/2221/ - Emulation

I'm also really missing the xkcd forums. The quality of the discussion was below what I'd expect to read on HN†, but it was still nice to have something for each of the comics.

† No disrespect intended to anyone who was on those forums—you're all great people, but there's less of you, and, well, there's nothing quite like HN.

[+] Analemma_|5 years ago|reply
Sometimes it seems like people writing Coq are trying to do this. Would it kill you to use variables besides n and x with subscripts?