3 ms·
Aren't these just normal parser combinators?
by xigoi 4y ago
Aren't these just normal parser combinators?
- WalterBright 4y agoA >> means right shift, except when it doesn't in the example.
- eru 4y agoWell, the problem here is the re-use of existing operators. (That's why it's great that Haskell and other languages in that family allow you to define your own operators, instead of eg re-using bit-shifting for IO.)
- WalterBright 4y agoDefining your own operators means combining the lexer with the semantic analysis, which comes with all sorts of complexities.
- eru 4y agoActually, no. At least the way it's handled in Haskell and OCaml avoids this problem. (Btw, parsing C++ is already Turing complete.)
- xigoi 4y agoYes, obviously operations with parser combinators are different that those with numbers. (Also, I find it kind of dumb to reserve short symbols for low-level operations that are rarely used in normal programming.)