Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> For some reason computer people are so conservative [...]

Well, one of the underlying reasons for the lack of imagination might be... keyboards. If keyboard keys were small e-ink displays, easily configurable and accessible by programs, programmers would have come up with a lot of interesting stuff already. We do it with function icons in regular interfaces. If we could intergrate with keyboards, we'd definitely take advantage of it.

Now, there might be many more reasons. The article also mentions subroutines displayed horizontally and other stuff. That could definitely be done too, but... while we aren't there yet, many interfaces definitely make good use of horizontal screen space.

The main problem is that to do any of these, you kinda require coordination beyond the scope of solving a single technical problem. Unless the right hardware is available to enough people, custom symbols and keys and whatever would only work experimentally. And it would be a worthy experiment, but developing a language is already enough work to also have to add a custom revolutionary IDE to the mix, in the context of experimentation. In the current economic system, when the path to market is long and unclear most good ideas die anonymously.



> If we could intergrate with keyboards, we'd definitely take advantage of it.

From my own personal experience this is extremely true. A while back I made myself a custom keyboard [0] which can enter lots of characters, mostly for linguistic tasks. I didn’t intend to start using it for things outside linguistics, but before long I was using it everywhere — and my inventory of available characters expanded correspondingly. I started to use curvy quotes and em/en-dashes in all my writings (even in this post!), and — more topically — I started using Unicode symbols in my programming, when possible. I don’t use them too much, mostly because there’s little need for them, but in scientific tasks it’s really useful to be able to type e.g. ‘λ’ instead of ‘wavelength’. I predict that as Unicode symbols become easier to input, programming languages will indeed start to utilise them more — the limiting factor is keyboard layout. (Indeed we can already see the start of this process in Julia, Raku and Haskell.)

[0] https://github.com/bradrn/Conkey


See also the Compose key: https://en.wikipedia.org/wiki/Compose_key.

I started using a Compose key under Linux five or six years ago. I have progressively accumulated fairly extensive customisation in my ~/.XCompose. (e.g. Compose+;+; = ‘, Compose+"+" = ”, Compose+"+` = ″, Compose+z+Space = ZWSP, Compose+Space+' = NARROW NO-BREAK SPACE, Compose+++1 = THUMBS UP SIGN), Compose+-+-+= = −, Compose+l+* = λ.) Some are of my own division, and some (like Greek letters) are copied from Vim’s digraphs which I had used commonly before setting up a Compose key. I consistently type exactly what I mean. (If I type a straight quote, I meant a straight quote.)

My last laptop ended up being a Surface Book; had WinCompose not existed, I wouldn’t have been willing to shift to Windows.


Check out https://docs.raku.org/language/unicode_ascii for an overview how Raku supports Unicode. And an article about its implementation from 2015: https://6guts.wordpress.com/2015/04/12/this-week-unicode-nor...


For anyone on Vim, you can insert lots of special characters by hitting Ctrl+K: =3 is ≡, -> is →, l* is λ, M- is —, etc. You can also run :dig! to see a list of all digraphs, and :help digraph for information on how to define your own.


And for those on emacs, you can change the input method. The one I use the most is the Tex one. so I can type \sum and things like that that gets translated to unicode immediately.


You can also use ^VuXXXX to insert characters by the hex Unicode value. I find that handy sometimes.


And you can put %B in your status line to show the Unicode value of what's under your cursor.


If I see a character I can't enter in someone's code, I think I'll run away. It's cool and all for your code, but sooner or later someone else is going to have to deal with it.


I think it matters who your audience is.

If your audience is mostly programmers then just use `*`

If your audience is physicists or mathematicians then `×` or `·` may be a better fit.

When turning a math expression into code, it is often handy if the code looks a lot like the expression. Even better if you can just copy and paste it. It's hard to translate an expression wrong if you aren't translating it at all.


I agree, which is why I avoid Unicode for anything someone else will need to type in, or at least give ASCII alternatives when possible. I use it mainly for things like local variable and parameter names.


> If keyboard keys were small e-ink displays, easily configurable and accessible by programs, programmers would have come up with a lot of interesting stuff already.

I have a QMK based keyboard. The most interesting thing I did was to have an APL layer on my keyboard. I wouldn't say it's "a lot of interesting stuff"


> Well, one of the underlying reasons for the lack of imagination might be... keyboards.

That and the fact that it would probably take me longer to search for whatever obscure mathematical symbol is supposed to represent <whatever> than it would take to just type out its name.

And ASCII is just easier to deal with.


Another problem with Unicode is far too many symbols for different Unicode characters are too similar looking, or even identical.

Then there are the Unicode symbols that convey semantic information rather than just the appearance. These are an abomination and should never have been put in Unicode, but here we are anyway.


Don't forget different Unicode code points for the same character, like U+4B/U+212A(/U+39A/U+41A/...).


If keyboards were only usable like that, we would have a problem of accessibility of the technology even worse than what it currently is.


> If keyboard keys were small e-ink displays, easily configurable and accessible by programs, programmers would have come up with a lot of interesting stuff already.

The touchbar on my M1 Macbook Pro does this. It makes using Emojis a lot easier. I incorporate emojis into my languages more and more nowadays.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: