Looking for a Lua alternative
cc
cc at nevernet.com
Thu Dec 14 19:50:08 UTC 2023
On Thursday, 14 December 2023 at 09:55:18 UTC, Hors wrote:
> On Thursday, 14 December 2023 at 09:43:03 UTC, solidstate1991
> wrote:
>> On Thursday, 14 December 2023 at 09:35:43 UTC, Sergey wrote:
>>> Maybe wren?
>>
>> Wren is one of those fashionable scripting languages that
>> skimp out on the integer support because "they can just be
>> represented with floating point numbers".
>
> Just a question: Isn't casting (rounding) floating numbers to
> integers an option? Why?
I had this issue with Lua 5.1. It "works" for medium-ish
integers, but as soon as you're encoding data in ints, such as
unique IDs made up of multiple components that may have high bits
set, it'll fall apart. I am still using Lua 5.1, but now I
just.. don't do that anymore. Unfortunately if you want to pass
along data that would otherwise be a 64-bit int, you either have
to send along a raw pointer or else create a Lua-GC-allocated
object to hold it instead (and at that point you may as well just
use userdata for the D object itself).
While not recommending it as such, I believe Julia supports
multiple int types, though my cursory examination suggested the
performance and resource draw is far, far worse than Lua.
More information about the Digitalmars-d
mailing list