Live data from Hacker News

Writing prettier Haskell with Unicode syntax and Vim

alt-romes.github.io

31–40 of 62 posts

Re: Writing prettier Haskell with Unicode syntax and Vim

#31
post #12

I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to even see the circle on the end of the lollipop symbol, no way I’m not mistaking that for a hyphen. I don’t know the names for these symbols, so my brain has to 1) learn new images, 2) pattern match them throughout the code. I would be totally lost. If the code…

IMHO the mathematical language is an impediment for learning math for exactly this reason. It's chock full of cryptic symbols with no obvious meaning that make it incomprehensible to anyone who has not taken years to learn it and also surprisingly difficult to enter into a computer. Math is hard to read because quill pens were difficult to use and much of the syntax was made up on the spot by people who were better at thinking mathematically than communicating ideas. But so many people have spent the effort to learn it that nobody wants to create a "dumbed down" version that a layman might understand.

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.

Re: Writing prettier Haskell with Unicode syntax and Vim

#32
post #14

Earlier quoted context omitted.

Agree, there is definitely a trade-off, I certainly don't know how to input those characters quickly even if the author states it is faster in Vim and I am not a Vim newbie. Also, if you get a stacktrace in a log file, do they still print nicely? Do they still print nicely if I'm viewing that stacktrace on a build server's web interface? There are probably some number of utilities that this code is "viewed" by that d…

Honestly, I would have had this concern ~10 years ago, but it's 2023. Unicode is ubiquitous, to the point that you'd need to pretty aggressively go out of your way to find things breaking due to it.

Roboto Mono doesn't support all the math glyphs, even some of the ones TFA uses: https://news.ycombinator.com/item?id=36438765

Re: Writing prettier Haskell with Unicode syntax and Vim

#33
post #12

I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to even see the circle on the end of the lollipop symbol, no way I’m not mistaking that for a hyphen. I don’t know the names for these symbols, so my brain has to 1) learn new images, 2) pattern match them throughout the code. I would be totally lost. If the code…

IMHO the mathematical language is an impediment for learning math for exactly this reason. It's chock full of cryptic symbols with no obvious meaning that make it incomprehensible to anyone who has not taken years to learn it and also surprisingly difficult to enter into a computer. Math is hard to read because quill pens were difficult to use and much of the syntax was made up on the spot by people who were better a…

If you open any reasonable math textbook (except for maybe logic related ones), chances are, you won't see the ∀ symbol anywhere at all. It's often considered bad taste to write a symbol like this when you can just write "for all". The main obstacle in learning math comes from not understanding the background material enough and basically never from not understanding the notation.

Re: Writing prettier Haskell with Unicode syntax and Vim

#34
post #22
post #12

I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to even see the circle on the end of the lollipop symbol, no way I’m not mistaking that for a hyphen. I don’t know the names for these symbols, so my brain has to 1) learn new images, 2) pattern match them throughout the code. I would be totally lost. If the code…

I agree. I read this line: > ∀ 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.

My guess is that the majority of Haskell programmers who are comfortable enough with the forall keyword to use it in practice would find the symbol ∀ to be more readable than the keyword, rather than less. (This is not snark, it's my actual belief.)

Re: Writing prettier Haskell with Unicode syntax and Vim

#35
post #30

Unicode in code might be what pushes people to consider variable-width font. Just look at the simple arrow in a text editor (hopefully the text filter on this website thinks this symbol is OK): → (U+2192 RIGHTWARDS ARROW). It’s tiny. And I notice that the author uses plain `->`. You do need at least an “em” width for that kind of symbol. But I wouldn’t want a normal variable-width font where colons are tiny and at-si…

It seems we're really close to making language specific fonts. Haskell would certainly be a prime candidate for this.

Fonts with "programming ligatures" have been a thing for some time now, and those ligatures tend to favor certain language families in practice.

Re: Writing prettier Haskell with Unicode syntax and Vim

#36

Earlier quoted context omitted.

IMHO the mathematical language is an impediment for learning math for exactly this reason. It's chock full of cryptic symbols with no obvious meaning that make it incomprehensible to anyone who has not taken years to learn it and also surprisingly difficult to enter into a computer. Math is hard to read because quill pens were difficult to use and much of the syntax was made up on the spot by people who were better a…

If you open any reasonable math textbook (except for maybe logic related ones), chances are, you won't see the ∀ symbol anywhere at all. It's often considered bad taste to write a symbol like this when you can just write "for all". The main obstacle in learning math comes from not understanding the background material enough and basically never from not understanding the notation.

And the notation are introduced to you gradually. Even books that do not have a chapter on the notation used, will have a reference page. If not, you’re not reading introductory material and some background is assumed.

Re: Writing prettier Haskell with Unicode syntax and Vim

#37
post #12

I’d like to voice the contrarian opinion that, as someone who isn’t a mathematician, these symbols make the code look like gibberish to me. I had to squint to even see the circle on the end of the lollipop symbol, no way I’m not mistaking that for a hyphen. I don’t know the names for these symbols, so my brain has to 1) learn new images, 2) pattern match them throughout the code. I would be totally lost. If the code…

IMHO the mathematical language is an impediment for learning math for exactly this reason. It's chock full of cryptic symbols with no obvious meaning that make it incomprehensible to anyone who has not taken years to learn it and also surprisingly difficult to enter into a computer. Math is hard to read because quill pens were difficult to use and much of the syntax was made up on the spot by people who were better a…

[deleted]

Re: Writing prettier Haskell with Unicode syntax and Vim

#38
post #30

Unicode in code might be what pushes people to consider variable-width font. Just look at the simple arrow in a text editor (hopefully the text filter on this website thinks this symbol is OK): → (U+2192 RIGHTWARDS ARROW). It’s tiny. And I notice that the author uses plain `->`. You do need at least an “em” width for that kind of symbol. But I wouldn’t want a normal variable-width font where colons are tiny and at-si…

It seems we're really close to making language specific fonts. Haskell would certainly be a prime candidate for this.

APL would say 'hi' using both its custom EBCIDIC code page(s) and its dedicated selectric ball.

Re: Writing prettier Haskell with Unicode syntax and Vim

#39
post #35
post #30

Earlier quoted context omitted.

It seems we're really close to making language specific fonts. Haskell would certainly be a prime candidate for this.

Fonts with "programming ligatures" have been a thing for some time now, and those ligatures tend to favor certain language families in practice.

Right, but they are general purpose monospace fonts. I would think something like a Haskell font or Python font would go beyond that and provide tailored designs for those languages. I wouldn't be surprised if those exist, but haven't seen them.

Re: Writing prettier Haskell with Unicode syntax and Vim

#40
post #30

Unicode in code might be what pushes people to consider variable-width font. Just look at the simple arrow in a text editor (hopefully the text filter on this website thinks this symbol is OK): → (U+2192 RIGHTWARDS ARROW). It’s tiny. And I notice that the author uses plain `->`. You do need at least an “em” width for that kind of symbol. But I wouldn’t want a normal variable-width font where colons are tiny and at-si…

It seems we're really close to making language specific fonts. Haskell would certainly be a prime candidate for this.

Is Hasklig not already such a font?

https://github.com/i-tu/Hasklig

Post reply on HN