Tony Wetmore | 9 Sep 1997 17:16

RE: Thread-support in LUA


Luiz,

> We currently are working on exactly this extension for Lua 3.1.

Do you have an idea when you might be releasing v3.1 of Lua?  Can
you describe what exactly you intend to implement in 3.1 to address
the "thread" issues discussed here?

Along with a co-worker, I am currently investigating various "embedded
languages" for use in our games, and need to decide which language
to integrate fairly soon.  The other languages we are currently considering
are Tcl and Python.

The single biggest problem that I see with Lua is the global environment,
where Lua seems to assume that you are only running one Lua program
at a time.

We would like to use an embedded programming language to control
many objects within our game, each having its own "brain".  Lua is one
of our top choices for such a language, obviously, but currently we
would add this multiple environment layer on top of Lua.  If you guys 
are already working on such an enhancement, however, that's better! :)

Thanks for all the great work!

+===========================================+=====================+
| Tony Wetmore (mailto: wetmore <at> kesmai.com) | Senior Programmer   |
|-------------------------------------------| Kesmai Studios      |
| Opinions are mine, ALL mine!              | Charlottesville, VA |
(Continue reading)

Roberto Ierusalimschy | 9 Sep 1997 18:41
Picon
Picon

Re: Thread-support in LUA

> Do you have an idea when you might be releasing v3.1 of Lua?  Can
> you describe what exactly you intend to implement in 3.1 to address
> the "thread" issues discussed here?

I think there was a misundertanding here. What was told in the other message
was that Lua 3.1 was going to support "closures", that is, nested functions
with proper lexical scope; check below:

> >A "psudo-overlapping" desire of mine is to
> >have first-class function definetions (like lambda functions, in that you
> >would do something like "boo = function(a,b) ... end". When I brought this
> >up before, it was said that the parser needs to be made reenterant for
> >this to work, so I was hoping to combine my efforts for these two things.
> 
> We currently are working on exactly this extension for Lua 3.1.
> Keep tuned. :-)

  Lua 3.1 also is going through a lot of "reengineering", for better
modularity, clarity of source code, etc. But it is not our goal now to
support multiple environments and/or threads.

  Multiple environments can be simulated by a proper manipulation of the global
variables. From a Lua point of view (not from C), the only global state are
the global variables. You can save all global variables in a table and later
restore those variables. In this way, you have a rather good approximation of
multiple environments.

(for instance, to save an environment, you can use:

function save ()
(Continue reading)


Gmane