[ANN] Lua 5.2.0 (beta-rc1) now available

classic Classic list List threaded Threaded
208 messages Options
1234 ... 11
Reply | Threaded
Open this post in threaded view
|

[ANN] Lua 5.2.0 (beta-rc1) now available

Luiz Henrique de Figueiredo
Lua 5.2.0 (beta-rc1) is now available at
        http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz

MD5 29b3219f21158d9861e18f2b7f0f55e3  -
SHA1 96d55f970588f3450857e4b5842dacfb9c5ebbd7  -

This is an beta version. Some details may change in the final version.

The main changes since Lua 5.1 are listed in
        http://www.lua.org/work/doc/#changes

The complete diffs since the alpha version are available at
        http://www.lua.org/work/diffs-lua-5.2.0-alpha-beta-rc1.txt

This release candidate will be the beta version if no glitches are found
in the next 10 days or so.

All feedback welcome. Thanks.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Peter Cawley
On Mon, Jun 13, 2011 at 7:33 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

> Lua 5.2.0 (beta-rc1) is now available at
>        http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz
>
> MD5     29b3219f21158d9861e18f2b7f0f55e3  -
> SHA1    96d55f970588f3450857e4b5842dacfb9c5ebbd7  -
>
> This is an beta version. Some details may change in the final version.
>
> The main changes since Lua 5.1 are listed in
>        http://www.lua.org/work/doc/#changes
>
> The complete diffs since the alpha version are available at
>        http://www.lua.org/work/diffs-lua-5.2.0-alpha-beta-rc1.txt
>
> This release candidate will be the beta version if no glitches are found
> in the next 10 days or so.
>
> All feedback welcome. Thanks.

Due to the introduction of labels, '@' can now appear as the first
character in a valid Lua chunk. This means that the following passage
from lua_Debug is incorrect: "If source starts with a '@', it means
that the function was defined in a file where the file name follows
the '@'. If source starts with a '=', the rest of it should describe
the source in a user-dependent manner. Otherwise, the function was
defined in a string where source is that string."

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Peter Cawley
In reply to this post by Luiz Henrique de Figueiredo
On Mon, Jun 13, 2011 at 7:33 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

> Lua 5.2.0 (beta-rc1) is now available at
>        http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz
>
> MD5     29b3219f21158d9861e18f2b7f0f55e3  -
> SHA1    96d55f970588f3450857e4b5842dacfb9c5ebbd7  -
>
> This is an beta version. Some details may change in the final version.
>
> The main changes since Lua 5.1 are listed in
>        http://www.lua.org/work/doc/#changes
>
> The complete diffs since the alpha version are available at
>        http://www.lua.org/work/diffs-lua-5.2.0-alpha-beta-rc1.txt
>
> This release candidate will be the beta version if no glitches are found
> in the next 10 days or so.
>
> All feedback welcome. Thanks.
> --lhf

The documentation relating to lua_arith seems incorrect with regard to
LUA_OPUNM. The code in lapi.c appears to create the second argument,
and thus does not require a dummy nil.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Xavier Wang
In reply to this post by Luiz Henrique de Figueiredo

Why goto and not continue?
Why break can appear middle of block but not return?
Can goto pass though local variable define?

在 2011-6-14 凌晨2:33,"Luiz Henrique de Figueiredo" <[hidden email]>写道:
> Lua 5.2.0 (beta-rc1) is now available at
> http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz
>
> MD5 29b3219f21158d9861e18f2b7f0f55e3 -
> SHA1 96d55f970588f3450857e4b5842dacfb9c5ebbd7 -
>
> This is an beta version. Some details may change in the final version.
>
> The main changes since Lua 5.1 are listed in
> http://www.lua.org/work/doc/#changes
>
> The complete diffs since the alpha version are available at
> http://www.lua.org/work/diffs-lua-5.2.0-alpha-beta-rc1.txt
>
> This release candidate will be the beta version if no glitches are found
> in the next 10 days or so.
>
> All feedback welcome. Thanks.
> --lhf
>
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Peter Cawley
> The documentation relating to lua_arith seems incorrect with regard to
> LUA_OPUNM. The code in lapi.c appears to create the second argument,
> and thus does not require a dummy nil.

It was corrected but not fully corrected:

Right:
  Performs an arithmetic operation over the two values
  (or one, in the case of negation)

Wrong:
  When the operation is @id{LUA_OPUNM},
  the caller must push a @nil value for the second operand.

Thanks for the feedback.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Petite Abeille
In reply to this post by Luiz Henrique de Figueiredo

On Jun 13, 2011, at 8:33 PM, Luiz Henrique de Figueiredo wrote:

> All feedback welcome. Thanks.

What happened to loadin? What's its replacement?


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Peter Cawley
In reply to this post by Luiz Henrique de Figueiredo
On Mon, Jun 13, 2011 at 7:33 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:

> Lua 5.2.0 (beta-rc1) is now available at
>        http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz
>
> MD5     29b3219f21158d9861e18f2b7f0f55e3  -
> SHA1    96d55f970588f3450857e4b5842dacfb9c5ebbd7  -
>
> This is an beta version. Some details may change in the final version.
>
> The main changes since Lua 5.1 are listed in
>        http://www.lua.org/work/doc/#changes
>
> The complete diffs since the alpha version are available at
>        http://www.lua.org/work/diffs-lua-5.2.0-alpha-beta-rc1.txt
>
> This release candidate will be the beta version if no glitches are found
> in the next 10 days or so.
>
> All feedback welcome. Thanks.
> --lhf

The documentation for table.sort says "table[1] to table[#list]" when
it should say "list[1] to list[#list]". I'd also question whether "not
comp(a[i+1],a[i])" should use "list" rather than "a".

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Petite Abeille
> What happened to loadin? What's its replacement?

It was merged into 'load'.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Peter Cawley
> The documentation for table.sort says "table[1] to table[#list]" when
> it should say "list[1] to list[#list]". I'd also question whether "not
> comp(a[i+1],a[i])" should use "list" rather than "a".

It should. Thanks (again).

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Patrick Donnelly
In reply to this post by Luiz Henrique de Figueiredo
On Mon, Jun 13, 2011 at 2:33 PM, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> All feedback welcome. Thanks.

o Is there a reason this idea [1] was scrapped?

o Also, since load is currently the only mechanism to set the _ENV
upvalue without using the debug API, I'd like to see a generator for
compiled chunks that let you set the _ENV upvalue:

function _main (_ENV)
  return function (...)
     --[[ chunk ]]
  end
end

While this can be done by modifying the source of Lua code, it can't
be done with precompiled bytecode. Perhaps most importantly, this
allows us to create a new closure of a compiled function without
recompiling it (or reloading the bytecode). If I want to run the same
function in different threads with different environments, I would
need to re-compile it each time to create a new closure, currently.

[1] http://lua-users.org/lists/lua-l/2011-01/msg01641.html

--
- Patrick Donnelly

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Petite Abeille
In reply to this post by Xavier Wang

On Jun 13, 2011, at 8:59 PM, Xavier Wang wrote:

> Why goto

Goto? Really? How quaint :P

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Peter Cawley
> Due to the introduction of labels, '@' can now appear as the first
> character in a valid Lua chunk. This means that the following passage
> from lua_Debug is incorrect: "If source starts with a '@', it means
> that the function was defined in a file where the file name follows
> the '@'. If source starts with a '=', the rest of it should describe
> the source in a user-dependent manner. Otherwise, the function was
> defined in a string where source is that string."

We thought about that. At the time, it seemed that users could simply
avoid starting a chunk with a label (a simple space, newline, or a
comment would be enough). But now that thought seems feeble. The two
obvious solutions would be to change the character that marks filenames
or the character that starts labels. The second option has the slight
advantage of not creating a small incompatibility. Suggestions?

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Dirk Laurie
In reply to this post by Luiz Henrique de Figueiredo
On Mon, Jun 13, 2011 at 08:33:19PM +0200, Luiz Henrique de Figueiredo wrote:
> Lua 5.2.0 (beta-rc1) is now available at
> http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz
>
_The_ event of 2011.

Suggestion for the reference manual:

<- The language supports this representation by providing a.name as
syntactic sugar for a["name"].

-> For a properly formed name (see §3.1), the language supports this
representation by providing a.name as syntactic sugar for a["name"].

Dirk

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Patrick Donnelly
> o Is there a reason this idea [1] was scrapped?

goto is more flexible and easier to write than break with labels (which
usually demand a new block to add a label).


> o Also, since load is currently the only mechanism to set the _ENV
> upvalue without using the debug API, I'd like to see a generator for
> compiled chunks that let you set the _ENV upvalue:
>
> function _main (_ENV)
>   return function (...)
>      --[[ chunk ]]
>   end
> end

Doesn't that seem too specific? ("A mechanism to set the _ENV upvalue of
binary chunks without using the debug API.") What is wrong with using
the debug API for this very particular case?

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Xavier Wang
> Why goto and not continue?

Because goto is much more flexible. For instance, the source code for
Lua has ~14 gotos and only 2 continues.


> Why break can appear middle of block but not return?

Because return may be followed by an optional expression. Something
like 'return a       = 3' would confuse the parser.


> Can goto pass though local variable define?

No. See the documentation.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Alexandre Erwin Ittner
In reply to this post by Luiz Henrique de Figueiredo
2011/6/13 Luiz Henrique de Figueiredo <[hidden email]>:
> Lua 5.2.0 (beta-rc1) is now available at
>        http://www.lua.org/work/lua-5.2.0-beta-rc1.tar.gz

Great!

Silly question: There is a reason other than being near to C for using
@label: as a label marker instead of simply @label ? Something related
to the debug interface or the interpreter or a syntactic ambiguity
that I failed to understand?

A "label" keyword would be great too, but it will break so much code.


--
Alexandre Erwin Ittner - [hidden email]
OpenPGP pubkey 0x0041A1FB @ http://pgp.mit.edu

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Patrick Donnelly
In reply to this post by Roberto Ierusalimschy
On Mon, Jun 13, 2011 at 3:59 PM, Roberto Ierusalimschy
<[hidden email]> wrote:

>> o Also, since load is currently the only mechanism to set the _ENV
>> upvalue without using the debug API, I'd like to see a generator for
>> compiled chunks that let you set the _ENV upvalue:
>>
>> function _main (_ENV)
>>   return function (...)
>>      --[[ chunk ]]
>>   end
>> end
>
> Doesn't that seem too specific? ("A mechanism to set the _ENV upvalue of
> binary chunks without using the debug API.") What is wrong with using
> the debug API for this very particular case?

I probably should have emphasized the more important use case: if I
want to use the same compiled chunk as the main function for multiple
threads but with different environments, the only solution is to
recompile the chunk multiple times. This is the case in 5.1 and 5.2.
[Granted you can wrap a chunk in a generator as above, but again, that
only works with regular Lua source. I feel modifying the source
shouldn't be necessary...]

--
- Patrick Donnelly

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Lorenzo Donati-2
In reply to this post by Roberto Ierusalimschy
On 13/06/2011 21.52, Roberto Ierusalimschy wrote:

>> Due to the introduction of labels, '@' can now appear as the first
>> character in a valid Lua chunk. This means that the following passage
>> from lua_Debug is incorrect: "If source starts with a '@', it means
>> that the function was defined in a file where the file name follows
>> the '@'. If source starts with a '=', the rest of it should describe
>> the source in a user-dependent manner. Otherwise, the function was
>> defined in a string where source is that string."
>
> We thought about that. At the time, it seemed that users could simply
> avoid starting a chunk with a label (a simple space, newline, or a
> comment would be enough). But now that thought seems feeble. The two
> obvious solutions would be to change the character that marks filenames
> or the character that starts labels. The second option has the slight
> advantage of not creating a small incompatibility. Suggestions?
>
> -- Roberto
>
>
>
Mmm, IMHO better to change the syntax for label.
BTW they look a bit ugly as they are now (but maybe this is intended :-)

If the start character must be something unused in Lua, there are few
alternatives among ASCII: #, $, |, &, ?, !, `.
Probably the best bets are # and $, since the other may better serve as
operators in Lua 9.5 :-P :-)

Moreover I find that colon at the end of a label distracting: it seems
to hint at a sort of connection with the following statement, which is
wrong (as I get from the docs - BTW a little goto usage example in the
manual won't hurt).

I would prefer something more "bulky", since labels mark point in code
and are statements syntactically, e.g.:

$MyLabel$

$[MyLabel]

$[MyLabel]$

#MyLabel#

#[MyLabel]

#[MyLabel]#


I like the versions with brackets best. They are bulky, they stand out
in code, but the label name is still readable (hoping they won't confuse
the parser).

Cheers
--Lorenzo


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Tony Finch
In reply to this post by Roberto Ierusalimschy
Roberto Ierusalimschy <[hidden email]> wrote:
>
> The two obvious solutions would be to change the character that marks
> filenames or the character that starts labels. The second option has the
> slight advantage of not creating a small incompatibility. Suggestions?

How about changing the label syntax to "name::" where :: is a new lexical
token.

There's an amusing syntactic difference in the functional programming
world, where ML uses :: for linked list construction and : for type
annotations, but Haskell is the other way around. So C++ uses : for labels
and :: for namespacing, and with this suggestion Lua would use :: for
labels and : for methods (with a vague handwavy connection to namespaces,
please ignore the man behind the curtain).

Tony.
--
f.anthony.n.finch  <[hidden email]>  http://dotat.at/
Fair Isle: Cyclonic 5 to 7 becoming northwest 7 to severe gale 9, decreasing 4
or 5 later. Moderate or rough, occasionally very rough in southeast. Rain or
showers. Moderate or good, occasionally poor.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.2.0 (beta-rc1) now available

Roberto Ierusalimschy
In reply to this post by Lorenzo Donati-2
> Mmm, IMHO better to change the syntax for label.
> BTW they look a bit ugly as they are now (but maybe this is intended :-)

It is.


> Probably the best bets are # and $, since the other may better serve
> as operators in Lua 9.5 :-P :-)

That makes sense.


-- Roberto

1234 ... 11