Writing prettier Haskell with Unicode syntax and Vim
alt-romes.github.io
alt-romes.github.io
It is kind of like everyone in the 60s decided that APL was the one true computer language and all interest in other languages died off entirely and when anybody complains about the syntax they are told that they just need to go to school for 4 years and they'll appreciate the beauty.
This is a serious drawback to the traditional math notation: if you didn't come up along one specific educational pathway, it seems to be effectively impossible to work your way in and figure out what any of it means. You can't pronounce any of it, you can't look it up; even if you can work out the names of the symbols, they often mean different things in different contexts. It is a mess.
For many years now, the way I have ingested CS papers is to read the introduction closely, getting my head around the concept, then bail out once the inscrutable symbols show up and go find an actual implementation in some real, documented, parseable programming language - any one will do - from which I can readily infer what the rest of the paper was supposed to mean.
Even in our own field, Computer Science, there are too many confusing cases: Knuth uses |S| to mean the cardinality of set S, |f| to be the number of solutions when f is a boolean, |x| to be the absolute value of x, |z| to be the absolute value of a complex number, and |a| to be the length of a. All within the same book, TAOCP vol 4A Part 1.
What "the size of" means is different applied to each type of object, and may have to be defined to explain some of them (esp. |f|), but it's common in math that general concepts apply differently to different things, while having some properties in common.
I think the notation is helpful rather than confusing because "the size of" carries with it some intuitive connotations which are common to each of those examples.
tldr; it’s tedious reading those proofs. And it’s laborious to write them. Such labour limits the thoughts one can have. Once algebra has solidified there was an explosion in the pace and depth of mathematics.
The symbols are there for a good reason.
In fact, it’s pretty common for math students to want to use only symbols at some point. What they write becomes unintelligible to everyone else (and maybe even themselves) and at some point they (usually) wise up.
> ∀ instead of forall, which is faster to input than the whole word.
It reminds me of the idiom that code is often written once but read often, so one would want to optimize for readability and not fewer keystrokes. At least for production code.
∀ might be just as incomprehensible as OOP for a starting programmer, but for anyone taking even a small amount of time to learn it is not difficult at all.
Otherwise it would be like asserting that programming would be better if we eschewed all specific jargon. Why say "bit" when we can say "single digit for which there are only 2 possible values"?
A solution to the problem if incomprehensibility is to use a plugin to replace the words. I use emacs prettify symbols:
https://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-do...
What does that mean for code that is being developed out in the open? Does it raise the bar for entry? Arguably there's already a bar to entry, which is being able to read English and being able to program in the first place. That there are some parts of the code that say "here be dragons" to the uninitiated who haven't yet Googled the meaning of the unfamiliar words and symbols seems like an entirely reasonable state of the world. If it's sufficiently popular, an explanation article, like https://en.wikipedia.org/wiki/Fast_inverse_square_root can be made, or an entire site, like http://explainxkcd.com.
There will always be more things to know (just today I learned about thixomolding. The science behind that has its own set of symbols to pick up), some of it will just require additional learning in order to learn.
LaTeX. I type \Beta, press TAB, and boom, β.
However, there is still a room for improvement: 1. Like was mentioned elsewhere in this thread on copy we could convert the symbol to how it is typed in order to support text (or even ASCII) only tools.
2. Better Integration with the browser and development tools like git so they get prettified when possible.
Does this mean I'm ready to embrace the use of mathematical notation via unicode glyphs in programming? No. I have a math degree and after dozens of university courses on math I've seen a lot of math notation. This notation uses a dizzying number of symbols across various mathematical disciples. LaTeX allows one to use any of 75 distinct kinds of arrows alone! Left, right, doubled, up, down, diagonal to the upper right, looped, long, bidirectional, harpooned, wiggly, maps-to, and so forth. That's just the arrows. Why does LaTeX allow typesetting with so many distinct arrows? Because mathematicians use them as distinct concepts.
I count 160 relational symbols available for use with standard LaTeX: less-than, equal, equivalent, congruent, subset, parallel, similar, approximate, the list goes on and on. See [1].
Mathematicians don't even use these symbols consistently. Consider the ubiquitous lambda, appearing all over in functional programming. Surely, the use of a lower-case greek lambda is prettier than spelling out the word 'lambda', but it may in many contexts not stand for an anonymous function. It's use as a symbol can also mean: wavelength of any wave, number of offspring, radioactive decay constant, occurrence density within a time interval, eigenvalues, charge density, Lagrange multiplier, empty string, and so forth. Wikipedia lists 24 distinct uses for lambda, [2].
Why do mathematicians, engineers, and scientists use so many different symbols? Because they are doing something fundamentally different with them than programmers. They use the symbols as abbreviations that will be understood by their audience, which might be students watching a lecture, readers of a technical article, or even themselves at some time in the future. The context in all of these uses is very different than the context of a program. The program must be precise and unambiguous, and the program may be one hundred times longer than a published math paper. For this reason, spelled out identifiers and keywords using standard ASCII glyphs are wordier and less "pretty" but are far more practical.
[1] https://www.cmor-faculty.rice.edu/~heinken/latex/symbols.pdf
[2] https://en.wikipedia.org/wiki/Lambda#:~:text=Lambda%20indica....
But I wouldn’t want a normal variable-width font where colons are tiny and at-signs are gigantic. I read a programming email list in my regular webclient and it can be quite tiring. :)
[0]: https://hakon.gylterud.net/tutorials/unicode.html
[1]: https://hakon.gylterud.net/tutorials/latex-maths-unicode.htm...
I haven't yet found a solution that works very well for macOS— a few years ago, some mappings were not possible with the solutions I found.
∀ ° ∫ Ω
Many people would not know their names, most people are probably unfamiliar to Greek letters beyond beta or gamma, with some exceptions for pi, which has the dubious property of being confusingly ambiguous if the constant is meant or a simple high-brow variation on a variable named p.
It's my conviction that there are a lot of things in computing that are made harder than they necessarily need to be by bad naming and chief amongst them is the insistence on borrowing mathematical notations and jargon.
In my mind, it is mostly a question of elitism and exclusion.
It's not like programming is completely devoid of terms of the art already. What's a Class? or an Object? or a Map? Etc. Etc.
That's just one example, Greek letters have been used in science for a very long time and I personally find code that uses the same notation used in literature easier to reason about and much more pleasant to read.
It's nice to be able to concisely document anything mathematical this way, it's also cute to be able to use the box drawing characters
I agree that this is very pretty, but font support is absolutely critical if you're going to do this.
[0] https://fonts.google.com/specimen/Roboto+Mono/glyphsThe biggest shortcoming is that emoji themselves have type-to-search, but math/international symbols don't and you either get to mouse through it or arrow/tab/enter through it.
But the nice advantage is that it has been built-in for several Windows versions now and you can count on it to work nearly everywhere.
[0]: https://espanso.org/