← Back to context

Comment by Dylan16807

14 hours ago

What kind of person understands and needs bitwise operators but can't easily remember & | ~ and the arrows for shift? It's very little information.

The part I'd call a hassle is the different kinds of right shift but you have that same hassle if you use keywords.

I like using the and/or keywords for logical operations. Now let's make bitwise look significantly different from that.

It's not about having to remember them, it's that you shouldn't waste these short single symbols on operations that are only rarely used.

This stuff (especially the ternary) are a step backwards. There is just no reason to waste | on a bitwise or that gets used at 1% of the frequency of the standard or. In the future you might have a better use for it (pipeline syntax, sum or union types come to mind in other languages).

I dislike basically everything about these syntax extensions.

  • Lua is very unlikely to want to add newer/less-common syntax with special symbols.

    Also a syntax for types can repurpose most symbols without being ambiguous.

    And you can overload the bitwise operators. You can configure __bor to give you pipelining right now.