[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: game developers?
- From: David Jeske <jeske@...>
- Date: Fri, 28 Jul 2000 15:24:45 -0700
On Fri, Jul 28, 2000 at 02:47:40PM -0300, Luiz Henrique de Figueiredo wrote:
> >>From lua-l@tecgraf.puc-rio.br Wed Jul 19 00:06:22 2000
> >From: David Jeske <jeske@chat.net>
> >
> >In closing, most of my Lua-wish-list features are pulled right out of
> >Python:
> > - simultaneous support for integer and floating point types
>
> Sometimes I think about this too, but in the end it always seems to complicated
> to be worth it, plus it would probably bring a performance hit.
> If you really need integers, then you probably do not need floating point...
Actually, my bigggest unsolved problem in this area is that I want to
be able to use 32-bit floating point AND be able to represent a
time_t. I end up using doubles just so I can handle units of time
reliably, which is somewhat of a waste.
> > - linked-list datatype
>
> Why do you need that?
> Tables in Lua are *the* data structure and everything else can be implemented
> with tables quite efficiently. What is wrong with a.next and a.prev?
1) a.next and a.prev is relatively slow (it's about 1/2 the speed of
Python lists, see comparison below)
2) a.next and a.prev can't handle very large lists. I originally
wanted to do 500000 iterations of the list_append_test, but
Lua3.2 and Lua4.0a both segfault when I try that many iterations.
(Do you have any idea why?)
Here is a comparison of Python and Lua40a with the Lua list containing
{ count, head, tail } and the elements containing {next, prev, item}.
Python:
list_append_test 50000 elapsed: 1.04663002491 seconds
list_traverse_test 500000 elapsed: 13.8836849928 seconds
http://www.chat.net/~jeske/Projects/ScriptPerf/download/all_test.py
Lua4.0a:
list_append_test 50000 elapsed: 1.814723
list_traverse_test 500000 elapsed: 23.28007
http://www.chat.net/~jeske/Projects/ScriptPerf/download/all_test.lua
> > - next tag-method (so you could truly implement a new type of table
> > or list datastructure. Although I assume Lua does not
> > have it because it's more complicated than it seems.)
>
> Yes, the semantics of a "next" tag method seems too complicated.
I worked on a solution to this for a while, and was mostly left
frustrated. Perhaps someday my mind will grab hold of an elegant
solution.
> > - Python style "for x in [a, b, c]" loop
>
> Lua 4.0 wil have this in the form
> for i,v in {a,b,c} do ... end
>
> Of course, any expression can appear in the place of {a,b,c}.
Is it using next() order or numeric order?
--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net