[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Generic optimizable operation syntax proposal
- From: Sergey Zakharchenko <doublef.mobile@...>
- Date: Mon, 6 Jun 2022 06:26:28 +0000
Luiz Henrique de Figueiredo <firstname.lastname@example.org>:
> If you want to experiment with this, try my ltokenp , a token
> processor for Lua.
I'm afraid I've already implemented the syntax and a couple transforms
with the respective operators, so I do have something to experiment
> It'll probably be easier if the new syntax is
> `f(...)`, because you can use f to decide what to do.
This would kind of defeat the purpose of the changes proposed. Suppose
I wrote an optimized version of e.g.
string.sub(<var>, 1, #<const str>) == <const str> and
and named it "consume" for some reason. Now a reader unacquainted with
the code would need to learn what consume() does when it's called (and
would need to build the C extension library just to try out the code).
In the syntax proposed, the code would literally say what it does, and
the code would still be runnable without building a C module.