[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: where the 4.0 API isn't better
- From: Reuben Thomas <rrt1001@...>
- Date: Fri, 13 Oct 2000 10:21:26 +0100 (BST)
> * ease of use * With 3.2, there was a read-only array for function
> arguments and simple stack for return values.
i.e. two different structures.
> stack, and it was easy to understand. In 4.0, there is no object structure:
> objects can only exist on the "stack" (really an array) and so now the whole
i.e. a single structure. To me, this is simplification, and I suggested it
(not knowing that it was already planned).
> API has to deal with this array. It's very easy to make semantical errors
> by specifying an incorrect array index.
I'm not clear on what's different from the "simple stack" in use in 3.2,
nor how it's easier to specify an incorrect array index with this version
than with the previous version.
> Stacks are not fun. That's why people stopped using Forth and started using
> Pascal and C.
Oooh...OK, I'll resist this bait!
> I'd be pulling my hair out). Using an array for interfacing is even more
> complicated than a stack.
I'm really confused now. Before there was an array and a stack; now
there's just a stack, and it's worse?!
> * efficiency when wrapping Lua concepts in C/C++ * Both API versions are
> low level-- as they should be-- and this level of API often needs to be
> wrapped. An example would be representing a Lua table with a C++ class. In
> the 3.2 API this was simple because the API already had the notion of
> objects for Lua values and functions for operating on these objects. With
> 4.0 we've lost that, and even the simplest representation requires constant
> referencing and dereferencing of objects in the array because the class
> representation could never know when the array might be altered, changing
> the index of the object it represents.
This I agree with completely: I'm really not sure what users of the API
gain from not being able to use lua_Objects directly as of old. A bit of
speed simply isn't worth it: Lua's not in the "fast" camp anyway.
http://sc3d.org/rrt/ | violence, n. bravery for cowards