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

I believe Odin's `^` syntax is a direct nod to Pascal. I for example had a prior experience with Delphi so it wasn't not too obscure.


That's true, but the keyboard issue is real. ` ^ ~ are dead keys on many keyboard layouts, requiring two keypresses to type.

I think they should be avoided for common operations in newly designed programming languages.


If you're a programmer you should know how to change keyboard layouts. I speak a couple languages that use accents, all my dead keys need to be combined with a compose key first.


So is ' for some keyboard layouts, but ' is still useful and evocative in many contexts.

There are not enough good symbols trivially typed on a keyboard to sacrifice half of them to dead keys. Either the dead key or the programming symbol can be mapped to a key combination.


> [dead keys] should be avoided for common operations in newly designed programming languages.

If that's the rationale for choosing which symbols should be allowed, then let's ban {} as they require AltGr+Shift in many layouts. And let's avoid <> (used as parentheses, e.g. for templates or XML tags, not as less-than/greater-than) because in ISO keyboards they loose all their symmetry. And what about shells, with /, one of the most used characters, relegated above 7 in many layouts?

Jokes apart, I like the choice of ^ or any other characters distinct from * for pointer dereference. To be more precise, I despise the use of the same symbol with different meaning. In C the same * is used for multiplication, pointer dereference and takes part in commments, too. You need full context to parse some cases, or you have to play with spaces:

  (a)*(b) // multiplication or casted deref?
  x/ *y // multiplication
  x/*y  // comment start
Same with &

  m&&n  // logical and
  m& &n // masked address


() are dead keys by that definition on almost every keyboard layout.


Parentheses are inserted by pressing two keys simultaneously. Diacritics on layouts that use dead keys are inserted by pressing two keys in sequence. Or, often, two keys simultaneously and then a third key in sequence (E.g. Shift-6 then Space for ^)

I'm Portuguese but live in the UK. The Portuguese layout (especially on macs) is dreadful for programming (because a bunch of important characters like brackets require Alt Gr to type), the UK layout sucks for writing Portuguese (because of the diacritics), so I ended up having to get used to US International as the compromise layout. I've gotten kind of used to it over the years, but the exact behaviour for dead keys varies a fair bit by platform, and especially on Linux can get quite aggravating.


I think on Linux, I took one of the key I never use (insert) and put it as the compose key. That resolved most of my issues with writing French.


FWIW --- programmer dvorak lets you type () without "shift" but both ~ and ^ require shift. https://www.kaufmann.no/roland/dvorak/


highly recommend every programmer set up hold/tap for their modifiers, including space cadet style parentheses.


LISP in shambles


!!




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

Search: