[ANNOUNCE] Lua 3.0 alpha

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

[ANNOUNCE] Lua 3.0 alpha

Luiz Henrique de Figueiredo
[I'm sorry if this is the second or third time you receive this.
 We've been having some problems with the listserver --lhf]

version 3.0 is now available for alpha testing at the usual sites (see below).
the documentation and the tests have not been updated yet.

the purpose of this release is to make sure that no programs have been broken.
please test it and send us your comments.
--lhf

* Changes since version 2.5 (no versions between 2.5 and 3.0)
  + NEW CONCEPT: internal methods based on tags replace fallbacks
    (but fully compatible with 2.5)
  + new, general syntax for constructors {[exp] = exp, ... }
  + userdata can now handle arbitrary binary data
  + support for handling variable number of arguments in functions (varargs)
  + support for conditional compilation ($if ... $else ... $end)
  + better support for writing libraries (auxlib.h)
  + luac can now also undump

* Availability
  The latest version of Lua is always available at the following locations:
  In Brazil:	ftp://ftp.icad.puc-rio.br/pub/lua/lua.tar.gz
  In Canada:	ftp://csg.uwaterloo.ca/pub/lhf/lua/lua.tar.gz
  In Germany:	ftp://ftp.uni-trier.de/pub/languages/lua/lua.tar.gz
  In Greece:	ftp://ftp.ntua.gr/pub/lang/lua/lua.tar.gz
  Home page:	http://www.inf.puc-rio.br/~roberto/lua.html
  The current version is 3.0alpha (the current *oficial* version is 2.5)

Reply | Threaded
Open this post in threaded view
|

Re: [ANNOUNCE] Lua 3.0 alpha

Veijo Vilva
On Apr 04, 1997 at 05:50:33PM -0300, Luiz Henrique de Figueiredo wrote:
> 
> version 3.0 is now available for alpha testing at the usual sites (see below).
> the documentation and the tests have not been updated yet.
> 
> the purpose of this release is to make sure that no programs have been broken.
> please test it and send us your comments.
> --lhf
> 

   An initial test indicates that v3.0a might work OK except for
   a slowdown by a factor of almost 4 :

     loj > time lua htmlp.lua < chap18.html > t.tex
     2.65user 0.06system 0:02.83elapsed 95%CPU
     loj > time lua3 htmlp.lua < chap18.html > tt.tex
     10.34user 0.12system 0:11.16elapsed 93%CPU
     loj > ls -l chap18.html
     -rw-r--r--   1 vilva    adm        101704 Apr  1 15:17 chap18.html
     loj > ls -l t.tex
     -rw-r--r--   1 vilva    adm        122229 Apr 16 08:25 t.tex
     loj > ls -l tt.tex
     -rw-r--r--   1 vilva    adm        122229 Apr 16 08:25 tt.tex
     loj > cmp t.tex tt.tex
     loj > 
     
   htmlp.lua is a restricted HTML to LaTeX converter script I wrote to
   evaluate lua. I made no changes to the configs in either case.

   The test environment is

      Linux version 2.0.30 (gcc version 2.7.2.f.1)

   The script and the test material are available at

      http://xiron.pc.helsinki.fi/lojftp/htmlp.lua
      http://xiron.pc.helsinki.fi/lojftp/reference-grammar/chap18.html
      
   
-- 
 Veijo Vilva                        [hidden email]
 Dept. Animal Science               http://xiron.pc.helsinki.fi/people/vilva
 P.O.Box 28                         PGP public key available on ./vvpgp.html
 FIN-00014 University of Helsinki   Tel. +358 9 708 5584

Reply | Threaded
Open this post in threaded view
|

performance of lua 3.0a

Roberto Ierusalimschy
>   An initial test indicates that v3.0a might work OK except for
>   a slowdown by a factor of almost 4 :

  We have detected a "performance bug" in v3.0a which might be responsible
for that. Waldemar Celes has got the same problem, and the profile of his
program starts with:

 18.93%   luaI_travfallbacks
 15.55%   checkfunc
  7.68%   lua_execute

  The problem seems to be in function luaL_arg_check (file auxlib.c). It is
always calling lua_getobjname: This last function is part of the debuger
interface, and it is very very slow (and calls luaI_travfallbacks, which
in turn calls checkfunc). The "bug" is that luaL_arg_check needs to call
lua_getobjname *only* if there is an error, which is very rare. Therefore,
it should be coded like:

void luaL_arg_check(int cond, int numarg, char *extramsg)
{
  if (!cond) {
    char *funcname;
    lua_getobjname(lua_stackedfunction(0), &funcname);
    if (funcname == NULL)
      funcname = "???";
    if (extramsg == NULL)
      luaL_verror("bad argument #%d to function `%s'", numarg, funcname);
    else
      luaL_verror("bad argument #%d to function `%s' (%s)",
                      numarg, funcname, extramsg);
  }
}

(that is, with the call to lua_getobjname inside the "if"). Please try that.


-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: performance of lua 3.0a

Veijo Vilva
On Apr 04, 1997 at 09:43:56AM -0300, Roberto Ierusalimschy wrote:
> >   a slowdown by a factor of almost 4 :
> 
>   We have detected a "performance bug" in v3.0a which might be responsible
[...] 
> 
> void luaL_arg_check(int cond, int numarg, char *extramsg)
> {
>   if (!cond) {
>     char *funcname;
>     lua_getobjname(lua_stackedfunction(0), &funcname);
>     if (funcname == NULL)
>       funcname = "???";
>     if (extramsg == NULL)
>       luaL_verror("bad argument #%d to function `%s'", numarg, funcname);
>     else
>       luaL_verror("bad argument #%d to function `%s' (%s)",
>                       numarg, funcname, extramsg);
>   }
> }
> 
> (that is, with the call to lua_getobjname inside the "if"). Please try that.
> 
> 
> -- Roberto
> 

    I modified the source as indicated, and got

    loj > time lua3 htmlp.lua < chap18.html > tt.tex
    3.19user 0.06system 0:03.33elapsed 97%CPU

    which is not bad for an alpha version (only ~20% slower than lua2.5)

    Thanks,

       Veijo

-- 
 Veijo Vilva                        [hidden email]
 Dept. Animal Science               http://xiron.pc.helsinki.fi/people/vilva
 P.O.Box 28                         PGP public key available on ./vvpgp.html
 FIN-00014 University of Helsinki   Tel. +358 9 708 5584