[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Adding an hex type in lua
- From: "Grellier, Thierry" <t-grellier@...>
- Date: Wed, 22 Nov 2006 18:09:43 +0100
Yes these "addresses" are pure data for me on whom I need to perform efficient computation, hence favoring new opcodes and new operators rather than defining function or using an usertype.
My need is specific but this weak bitwise/unsigned integer support due to the number representation was close being a stopper from using Lua in my case. It didn't help me explaining this is still a serious language to be considered and not a toy which, besides this problem, is well suited for our needs.
One consequence was however that it hasn't been used wherever it may have been. Thus Lua is currently only used for configurations. And these configurations contain "addresses", being a matter of suspicion.
The usage of strtod in lua introduced a support for hex notations but more as a side effect than a fully desired feature, so with unclear semantic. There is actually little dead code in Lua, because it tries to handle hex notation whereas they already have been coped with by strtod.
The idea of this patch is to define a partition between what is ought to be used with hex notation and what is ought to be a number, without much change in the number concept. So it may also avoid introducing an integer type to achieve the same goals.
Providing this patch also gives a hint on the overhead of introducing a new type which might need to be considered for an embedded language: one can then compare to the saved byte codes on embedded systems with strong memory constraint, and that being optional select the best configuration.
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of David Jones
Sent: Wednesday, November 22, 2006 11:07 AM
To: Lua list
Subject: Re: Adding an hex type in lua
On 21 Nov 2006, at 21:24, Mildred wrote:
>
> Le mar 21/11/2006 à 18:00 Grellier, Thierry à écrit:
>> I need to manipulate addresses. These addresses would be happy with
>> specific operators, namely bitwise operators. Currently the address I
>> manipulate are 32 bits, but I may imagine they become 64bits in
>> future.
>
> Why not using light userdata, maybe redefining the metatable
> associated
> with all light userdata. As far as I know, light userdata are just
> void* pointers.
I think from what he's said in previous posts that the addresses
being manipulated are not addresses in the address space of the C
process running Lua. They're addresses that appear on a memory bus
whilst running a simulation of a piece of hardware.
drj