[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Generic optimizable operation syntax proposal
- From: Sergey Zakharchenko <doublef.mobile@...>
- Date: Fri, 3 Jun 2022 21:56:27 +0300
Hello Andrew,
Andrew Starks <andrew@starksfam.org>:
> One use case might be to have an optimized time symbol that is tied to a PTP clock. Maybe this would be faster than using a required library and that could be significant in applications that make decisions based on that clock?
Possibly. Like I said, everyone's use case is different, Lua being an
embedded language.
> If that is not a correct example, can you correct that or give another example of a use case where this might be useful?
Grep any codebase with generic code for type checks, and you get the
reasoning behind the example I gave: `(type(a)=="number") and the
likes of it. More complex checks could involve a value being table or
a userdata with metatable. For other ideas, see e.g.
https://github.com/Roblox/luau/blob/61766a692c53cae3ea47408fb0c38f9b1af786d8/Common/include/Luau/Bytecode.h#L396
.
Best regards,
--
DoubleF