[ANNOUNCE] Lua 3.1 alpha

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANNOUNCE] Lua 3.1 alpha

Luiz Henrique de Figueiredo
Lua 3.1 is now available for *alpha* testing at

	ftp://ftp.icad.puc-rio.br/pub/lua/lua-3.1alpha.tar.gz
	ftp://csg.uwaterloo.ca/pub/lhf/lua/lua-3.1alpha.tar.gz

This package includes updated documentation in lua/doc.
See below for a list of major changes and incompatibilities.
Please report any problems.
Thanks.
--lhf

* Changes from version 3.0 to 3.1 alpha
  + NEW FEATURE: anonymous functions with closures (via "upvalues").
  + new syntax:
    - local variables in chunks.
    - better scope control with DO block END.
    - constructors can now be also written: { record-part; list-part }.
    - more general syntax for function calls and lvalues, e.g.:
      f().x=1
      o:f(x,y):g(z)
  + major code re-organization and clean-up; reduced module interdependecies.
  + support for multiple contexts.
  + new traversal functions "foreach" and "foreachvar".
  + changing lua to use doubles instead of floats is now trivial.
  + complete debug information stored in pre-compiled chunks.

* Incompatibilities from Lua 3.0 to 3.1 alpha

- To support multiple contexts, Lua 3.1 must be explicitly opened before used.
  However, all standard libraries check whether Lua is already opened, so any
  program that opens at least one standard library before using Lua API does
  not need to be modified.

- Function "dostring" no longer accepts an optional second argument, with a
  temporary error method. This facility is now provided by function "call".

- Function "gsub" no longer accepts an optional fourth argument (a callback
  data, a table). Closures replace this feature with advantage.

- The syntax for function declaration is now more restricted;
  for instance, the old syntax "function f[exp] (x) ... end" is not accepted in
  3.1. In these cases, programs should use an explicit assignment instead, like
  "f[exp] = function (x) ... end".

- Old pre-compiled code is obsolete, and must be re-compiled.

- The option "a=b" in Lua stand-alone now sets "a" to the *string* "b",
  and not to the value of "b".

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

Steve Dekorte-2
>Lua 3.1 is now available for *alpha* testing...
>
>* Changes from version 3.0 to 3.1 alpha..

Wow - these are really great improvements!

I also remember some talk about improved VM performance.
Is that in 3.1 also?

Steve Dekorte

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

David Jeske-2
In reply to this post by Luiz Henrique de Figueiredo
First off, I'll say that I'm glad to see 3.1 finally available. Much of what it
provides will make my code much cleaner, and thus my life much easier. Particularly
anonymous functions.

On Wed, Jan 14, 1998 at 07:39:00PM -0200, Luiz Henrique de Figueiredo wrote:
> Lua 3.1 is now available for *alpha* testing at
>   + support for multiple contexts.

However, I'm curious to know why the multiple contexts are switched by switching a
global variable. This single piece of global state makes it impossible to run two
lua environments simultaneously in separate OS threads. I would much prefer (and
will spend my time converting 3.1 to do this) if the environment was explicitly
passed around as the first parameter of lua functions. In the interest of backward
compatibility for C code I can see how having the public lua functions use a global
state variable is convinent, however, I really want to have new versions of these
functions where I explicitly pass in the environment pointer also.

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

Luiz Henrique de Figueiredo
In reply to this post by Luiz Henrique de Figueiredo
>From [hidden email] Wed Jan 14 21:32:20 1998
>
>I also remember some talk about improved VM performance.
>Is that in 3.1 also?

Some opcodes have been added, some have been removed, some have changed.
All of course aiming at makeing Lua better still.
Whether they'll make your programs faster depends on what they do.
So, you tell us!
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

Luiz Henrique de Figueiredo
In reply to this post by Luiz Henrique de Figueiredo
>From [hidden email] Thu Jan 15 01:09:44 1998
>
>However, I'm curious to know why the multiple contexts are switched by switching a
>global variable. This single piece of global state makes it impossible to run two
>lua environments simultaneously in separate OS threads.

We know about this. However, different OS's deal with multithreading in
different ways, all non-ANSI and all non-POSIX (I think multithreading is
still a proposal in POSIX).
Besides, we think that multiple contexts are useful for things other than
multithreading.

>I would much prefer if the environment was explicitly
>passed around as the first parameter of lua functions.

We agree that this is a complete solution and would make multithreading simple.
We haven't discarded this possibility yet. The single global variable storing
the complete state is a step towards this but we prefer to see how people use
it first.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

David Jeske-2
On Thu, Jan 15, 1998 at 08:12:10AM -0200, Luiz Henrique de Figueiredo wrote:
> >However, I'm curious to know why the multiple contexts are switched by switching a
> >global variable. This single piece of global state makes it impossible to run two
> >lua environments simultaneously in separate OS threads.
> 
> We know about this. However, different OS's deal with multithreading in
> different ways, all non-ANSI and all non-POSIX (I think multithreading is
> still a proposal in POSIX).
> Besides, we think that multiple contexts are useful for things other than
> multithreading.

I understand. If there is one thing that is non-standard across platforms it's
multithreading. I would never suggest Lua include "direct" support for
multithreading.

> >I would much prefer if the environment was explicitly
> >passed around as the first parameter of lua functions.
> 
> We agree that this is a complete solution and would make multithreading simple.
> We haven't discarded this possibility yet. The single global variable storing
> the complete state is a step towards this but we prefer to see how people use
> it first.

Okay, I'll give a status update if/when I end up changing the code to explicitly
pass aroud the environment. :) 

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.1 alpha

Russell Y. Webb
In reply to this post by Luiz Henrique de Figueiredo
Looks great.

I want to start thinking about transfering my global access control 
system (using a "global" list) to 3.1.  Is it too early to start thinking 
about that?  I would need the lua.stx file which doesn't seem to be in 
the alpha release.

Thanks for all the interesting features.

Russ