
Hello list,
One of Lua's greatest strengths is its hackability. It's possible to
add custom opcodes and operators representing them, but in doing so,
we break sourcelevel compatibility. What if we could have a universal
and familiar syntax representing the operations? Here's what I have on
my mind:

In BNF: edit
prefixexp ::= var  functioncall  ( exp )
to read
prefixexp ::= var  functioncall  ( exp )  ` ( exp )
In _expression_ documentation, add:
`(exp) is equivalent to exp, but possibly optimized in an
implementationspecific manner.

E.g. print(`(fn())) would be equivalent to print(fn()) (and, in
particular, NOT to print((fn()))).
The noop implementation of the above should be trivial. Actual
optimizationcapable implementations could be larger, require larger
lookahead, etc. but could encode typical operations as
implementationspecific opcodes with no need to expose them on the
source level. Therefore, such implementations would be
sourcelevelcompatible.
In general, such optimizations could be questionable, e.g.
`(type(a)=="number")) needs 'type' to be accessible and point to the
real 'type', which may not be the case (you never know what's in that
_ENV). Therefore, they need to be explicitly enabled at load (parse)
time, by conditional compilation, or something like:

In load function documentation, add:
The string 'mode' may contain '`(...)' where characters inside the
parentheses indicate implementationspecific optimization parameters
(significant only if the mode string contains 't').

All feedback welcome!
Best regards,

DoubleF