[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Native Complex numbers for LuaJIT-2 [was Re: Benchmark shootout shows LuaJIT 2.0]
- From: Francesco Abbate <francesco.bbt@...>
- Date: Mon, 2 Nov 2009 16:06:09 +0100
2009/11/2 Mike Pall <email@example.com>
> Without causing undue trouble to the VM, they would have to be
> boxed (in a userdata or an even smaller container). And one would
> have to add a special kind of array type to store them, because
> storing boxed values in a table is just too much overhead for
> numerical programs.
I think that native support for complex numbers would be a *great*
plus for numerical calculations. I think also that complex numbers
should be supported, if possible, as a native type just like Asko's
LNUM patch is doing. Also, I'm not sure that you need a struct to
represent complex number, in C99 they are a native type just like
'int' or 'double'
I guess anyway that integration with the LuaJIT VM can absolutely non trivial.
Otherwise, me too, I'm impressed by your work and I have a small
unrelated question. I was wondering if the JIT compiler is also able
to optimise Lua functions called with 'lua_call' from within a C
library code (called, in turn, from Lua top level).
Thank you a lot in any case for sharing your work!