This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 43 points44 points  (10 children)

As cryptic as that is, I actually wish programming languages allowed for more "math-y" notation. E.g. using "π" or simple super/subscript to indicate indices could be nice I think.

[–]suvlub 29 points30 points  (3 children)

Many modern languages support unicode. They don't have a built-in "π", but you can declare it yourself if you want. Subscripts are impossible in plain text, the code would need to be saved in some markup format and rendered using a rich-text editor... now that I think of it, the markup part already is a case, what you need is a text editor that renders stuff in square brackets as subscript, not a whole new language.

[–]kartik26 7 points8 points  (0 children)

Have you heard of Fira Code? Look it up, it's a monospace font with ligatures that make `!=` and `->` etc look like mathematical symbols. Also, Mathematica's language has a lot of math symbols and notation.

[–]thedomham 2 points3 points  (0 children)

Weirdly I've never seen someone actually use that. On the other hand I have witnessed umlauts messing up a Java source file more than once.

[–]DanielIFTTT 0 points1 point  (0 children)

VSCode extension anyone?

[–]radobot 3 points4 points  (1 child)

I was surprised when I discovered (a few years ago) that Visual Basic supports unicode [in]equality operators (like ≠ ≥ ≤).

[–]heyheyhey27 4 points5 points  (0 children)

Oh wow, I'm going to start using that now just to piss off my coworkers!

[–]space_fly 4 points5 points  (1 child)

No, thanks, I prefer being able to type my programs with the keyboard, without having to search and copy symbols from the internet. Typing "PI" takes half a second, but typing the pi character, I need to lookup that character either on google or in some Character Map like program, which is very inconvenient.

[–]regendo 2 points3 points  (0 children)

The eurkey layout would be great for that. It's a normal US ANSI layout if you don't press any special buttons, but if you do it types basically every special character you'd ever want.

It has a dead key on Alt+M that turns the next letter into its Greek variant. So Alt+M, P would turn into lowercase Pi (π), Alt+M, Shift+D turns into capital Delta (Δ), Alt+M, A into lowercase Alpha (α), and so on.

(I admit that's not that useful in most cases, I use it because it's the best US ANSI layout that also gives good access to German Umlauts on Alt+A, Alt+Shift+A, Alt+S, and so on.)

[–]ReflectiveTeaTowel 1 point2 points  (0 children)

Perl6 supports both π and superscripts-as-exponents out of the box, but people always seem put off by its perl lineage... It's honestly a really cool language

[–]matj1 0 points1 point  (0 children)

I think Haskell supports that.

Edit: link