64 bit Integers #61
LostTime76
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
Playing the devil's advocate, what exactly is holding you back from using Lua? Lua offers several ways how to work with 64b integers: https://stackoverflow.com/questions/3104722/does-lua-make-use-of-64-bit-integers . |
Beta Was this translation helpful? Give feedback.
2 replies
-
Would the pointer type fulfill your needs? https://fubark.github.io/cyber/docs/toc/ffi/#pointers |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am actually in the market right now for a scripting language to embed in an application and that is my #1 reason for looking at cyber. After just evaluating the Python C API, it is a giant pile of garbage and lua seemed to be a much better option for easy embedding for my purposes.
However, I have a particular use case in mind. I need to be able to pass 64 bit integer values between the scripting language and the application as they represent object pointers. On modern 64 bit machines, pointer addresses are 64 bits. Would it be possible to store those pointer values in numbers, which are 64 bit doubles and not have them truncated or modified? Essentially, cyber does not need to interpret the value; however, an object from cyber would have to pass the value back to the end application so it can recover back its pointer.
The application would embed the scripting language engine and would provide "extension" (python terminology) functions, objects, or modules that the script could then utilize. The script would call one of the extension APIs and an object internally gets created by the application and passed back to the script as an 'opaque handle', which would be a 64 bit pointer. The script would then call subsequent extension functions and pass the handle in. In the extension functions, the application can recover the pointer and operate on the object.
Beta Was this translation helpful? Give feedback.
All reactions