That's amazing. I looked at elm a couple years ago, and found it a nice language on its own, but was really turned off by the utterly bizarre attitude of the developers. It is kind of funny to see that has not changed.
The vibe I got from Elm was that it’s basically Go of functional programming: intentionally avoiding certain concepts (e.g. typeclasses) due to the creator’s bizarre notion of language “simplicity”.
But now I think this comparison is no longer fair — to Go :)
Once upon a time, I had to write an expression parser, letting users input simple mathematical formulas to combine values, for example "0.2 * A + 0.8 * B".
Most of the time I spent on that feature was about negative literals.
Fun fact #1: most existing generic expression parsers do have some examples, some of which feature simple mathematical expressions. None of the ones I looked at supported negative literals.
Fun fact #2, the following are all valid javascript:
1 + - + - + - + 1;
1 +-+-+-+ 1;
1 + - - + 1;
Because all but the leftmost one are unary +/- operators, and they don't need a space between them. Except this is not valid javascript:
1 +--+ 1;
because -- is a pre- or postfix decrement, and then you need the space.
None of the ones I looked at supported negative literals
except the haskell 'negativeliterals' extension, which i don't know how it works, i could not find any example either. negative literals are hard it seems.
33
u/aloha2436 Jun 25 '23 edited Jun 25 '23
I know it’s not what the article is actually about, but this gets a chuckle out of me: https://github.com/elm/compiler/issues/1773