http://www.perlmonks.org?node_id=1200775


in reply to Re^2: Small Perl 6 discoveries IV, hash access
in thread [Perl6] Perl 6 discoveries IV, hash access

On a related note, what's a good editor

Well, of course emacs and vi! ;-)

for typing weird unicode characters that perl6 likes, such as double angle brackets « »?

Probably the same as you use now. The double angle brackets are part of ISO-8859-1 and its supersets ISO-8859-15, and Windows-1252 (at positions 0xAB and 0xBB), ISO-8859-9 (at the same positions), ISO-8859-13 (also at 0xAB and 0xBB), and ISO-8859-16 (again at the same positions). Mac Roman has them at 0xC7 and 0xC8.

It's not so much an editor problem, but a keyboard layout problem.

The commonly used keyboard layouts don't even have mappings for all symbols in the ISO-8859-x series. Keyboard layouts were designed for people writing texts in one or a few local languages, on mechanical typewriters. Computer keyboards have largely copied those layouts. See https://en.wikipedia.org/wiki/Keyboard_layout for the big picture, and the keyboard layouts shown in https://de.wikipedia.org/wiki/Tastaturbelegung for a lot of European layouts.

Look at the classic US layout. It is good for ASCII, but nothing more. The UK layout has some french accented characters due to the french influences in old times. The extended variant adds some more.

The standard German layout used in Germany and Austria has umlauts (ÄÖÜäöü), the sharp s (ß), and dead keys for writing French and some other accented languages. But it lacks a key kombination for Ç and ç, also used in French. There are two extended variants (T2 and T3) that are rarely used and practically not available printed or engraved in key caps. T2 is suitable for all latin-based official languages of europe, T3 adds support for minority languages.

Guess which layout is used in Switzerland. Right, they have their own layout, optimized for typing German, French, Italian and Romansh on a single keyboard. And you won't find the sharp s (ß) on that keyboard, because Swiss german does not use it.

Hop through a few more layouts (QWERTZ, AZERTY, QWERTY) and you will see a mess of mappings. Layouts for a larger set of language, e.g. US-International are available, and even actually used (e.g. in the Netherlands). BTW: The US-International keyboard allows typing the double angle brackets.

But 10 Fingers and "only" about 100 keys make it hard to enter all of Unicode. Unicode currently (v10.0) has 139 scripts using 136755 characters, and there is still room for more. So even in future, keyboard layouts will suck if you need to type "exotic" characters. Perhaps even more than today.

People keep inventing new keyboard layouts, optimized for something, making them hardly useable for something else. There is no best keyboard layout for everything, like there is no best editor for everything.

Many people prefer coding using the US or the US-International keyboard, simply because most popular programming languages were designed to use the US keyboard.


There is a solution from the early days of C, using trigraphs instead of characters not available on all platforms and keyboards: http://codingfox.com/4-5-trigraph-characters-in-c-language/

Trigraph SequenceEqual character
??=#
??([
??)]
??/\
??<{
??>}
??!|
??’^
??-~

This makes hello world look a little bit funny, but it is still readable:

??=include <stdio.h> int main() ??< printf("Hello??/nWorld"); return 0; ??>
#include <stdio.h> int main() { printf("Hello\nWorld"); return 0; }

I would expect that Perl6 has a similar feature to express "uncommon" Unicode characters by using replacement ASCII sequences. And of course, a little bit of searching ends at Unicode versus ASCII symbols.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)