Upgrade Lua to 5.2.0 #253

Closed
antirez opened this Issue Dec 17, 2011 · 16 comments

Comments

Projects
None yet
6 participants
@antirez
Owner

antirez commented Dec 17, 2011

The title says it all.

@ghost ghost assigned antirez Dec 17, 2011

@nrk

This comment has been minimized.

Show comment
Hide comment
@nrk

nrk Dec 19, 2011

From user's perspective I don't think Lua 5.2.0 brings much changes affecting how Lua is used in the context of Redis scripting compared to Lua 5.1.4, but it might be desirable to debut with 5.2.0 right off the bat since scripting is a brand new feature in Redis. My only concern is about stability: Lua 5.1.4 has been around for a few years now while 5.2.0 has been released a couple of days ago or so.

nrk commented Dec 19, 2011

From user's perspective I don't think Lua 5.2.0 brings much changes affecting how Lua is used in the context of Redis scripting compared to Lua 5.1.4, but it might be desirable to debut with 5.2.0 right off the bat since scripting is a brand new feature in Redis. My only concern is about stability: Lua 5.1.4 has been around for a few years now while 5.2.0 has been released a couple of days ago or so.

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Dec 19, 2011

Owner

@nrk yes the reason I want to start with 5.2.0 is exactly that scripting is new into Redis, and since they are differences between Lua 5.2 and 5.1, better to start with the new one that will be likely semantically identical to the next 5.2.x releases for years before a 5.3.0 will appear.

About stability, that's an issue, I think we can just hope that the Lua team did a great work about that... but fortunately we can upgrade to the latest patch release of Lua before Redis 2.6 moves from RC to stable.

Thanks for your comment.

Owner

antirez commented Dec 19, 2011

@nrk yes the reason I want to start with 5.2.0 is exactly that scripting is new into Redis, and since they are differences between Lua 5.2 and 5.1, better to start with the new one that will be likely semantically identical to the next 5.2.x releases for years before a 5.3.0 will appear.

About stability, that's an issue, I think we can just hope that the Lua team did a great work about that... but fortunately we can upgrade to the latest patch release of Lua before Redis 2.6 moves from RC to stable.

Thanks for your comment.

@arnaudsj

This comment has been minimized.

Show comment
Hide comment
@arnaudsj

arnaudsj Dec 19, 2011

I think moving to 5.2 ASAP is a wise move. Only plus of staying with the 5.1 branch would be to maybe use luaJIT as the runtime?It is several order of magnitude faster, but again I am not sure how more difficult it would be to embed within redis versus the vanilla C lua runtime.

I think moving to 5.2 ASAP is a wise move. Only plus of staying with the 5.1 branch would be to maybe use luaJIT as the runtime?It is several order of magnitude faster, but again I am not sure how more difficult it would be to embed within redis versus the vanilla C lua runtime.

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Dec 19, 2011

Owner

@arnaudsj for now LuaJIT is not in the short term plans since usually Redis scripts don't use time for running Lua code but for calling Redis commands, so it will likely not advantage performances significantly... and the "standard" Lua implementation is simple clean ANSI C code :)

Thanks, I take this as a +1 vote for 5.2 ;)

Owner

antirez commented Dec 19, 2011

@arnaudsj for now LuaJIT is not in the short term plans since usually Redis scripts don't use time for running Lua code but for calling Redis commands, so it will likely not advantage performances significantly... and the "standard" Lua implementation is simple clean ANSI C code :)

Thanks, I take this as a +1 vote for 5.2 ;)

@catwell

This comment has been minimized.

Show comment
Hide comment
@catwell

catwell Dec 19, 2011

Contributor

I would say 5.2 has two advantages over 5.1 for Redis: the bit library as part of the language and the emergency GC. However I don't really think those are important enough to justify a change.

Stability is not an issue. Lua 5.2 work versions have been public for almost two years now.

Contributor

catwell commented Dec 19, 2011

I would say 5.2 has two advantages over 5.1 for Redis: the bit library as part of the language and the emergency GC. However I don't really think those are important enough to justify a change.

Stability is not an issue. Lua 5.2 work versions have been public for almost two years now.

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Dec 19, 2011

Owner

Thank you, everything considered I've decided to upgrade, for one main reason: support from Lua project. I bet that the core developers of Lua will focus on 5.2.x in the next years, and we want to have the most supported release inside Redis to avoid being second-order citizens.

Will upgrade it today.

Salvatore

Owner

antirez commented Dec 19, 2011

Thank you, everything considered I've decided to upgrade, for one main reason: support from Lua project. I bet that the core developers of Lua will focus on 5.2.x in the next years, and we want to have the most supported release inside Redis to avoid being second-order citizens.

Will upgrade it today.

Salvatore

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Dec 19, 2011

Owner

Actually I changed idea, got a working version of Redis using 5.2 in twenty minutes, but many changes were needed, including in the lua_cjson library we ship together with Lua. At this point this are too many changes for 2.6.0 that will get RC1 hopefully in the first weeks of 2011.

I'll keep the 5.1 to start, let's see if it will be worth it to switch to the new version in Redis 3.0.

Owner

antirez commented Dec 19, 2011

Actually I changed idea, got a working version of Redis using 5.2 in twenty minutes, but many changes were needed, including in the lua_cjson library we ship together with Lua. At this point this are too many changes for 2.6.0 that will get RC1 hopefully in the first weeks of 2011.

I'll keep the 5.1 to start, let's see if it will be worth it to switch to the new version in Redis 3.0.

@antirez antirez closed this Dec 19, 2011

@leonfs

This comment has been minimized.

Show comment
Hide comment
@leonfs

leonfs Nov 14, 2014

This thread is a bit old, but is there any chance that Lua 5.2 will be included in soon?

leonfs commented Nov 14, 2014

This thread is a bit old, but is there any chance that Lua 5.2 will be included in soon?

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Nov 14, 2014

Owner

I'm a bit worried about backward compatibility, it is unlikely that we will upgrade, it is likely that we'll add 5.2 compatible bit functions however. However I would like some help from Lua experts. How many scripts we'll break if we upgrade? Thanks.

Owner

antirez commented Nov 14, 2014

I'm a bit worried about backward compatibility, it is unlikely that we will upgrade, it is likely that we'll add 5.2 compatible bit functions however. However I would like some help from Lua experts. How many scripts we'll break if we upgrade? Thanks.

@mattsta

This comment has been minimized.

Show comment
Hide comment
@mattsta

mattsta Nov 14, 2014

Contributor

Also on...

Contributor

mattsta commented Nov 14, 2014

Also on...

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Nov 14, 2014

Owner

Thanks Matt, 1663 seems like a lot of good things sitting there. 1662 looks also good but the problem is if we should instead go for the Lua 5.2 nowaday standard API.

Owner

antirez commented Nov 14, 2014

Thanks Matt, 1663 seems like a lot of good things sitting there. 1662 looks also good but the problem is if we should instead go for the Lua 5.2 nowaday standard API.

@mattsta

This comment has been minimized.

Show comment
Hide comment
@mattsta

mattsta Nov 14, 2014

Contributor

1662 looks also good but the problem is if we should instead go for the Lua 5.2 nowaday standard API.

They were actually added to Lua 5.2 then removed in Lua 5.3. The bitops package is the recommended thing to use across all versions. :)

Added to 5.2: http://www.lua.org/manual/5.2/readme.html#changes
Removed in 5.3: http://www.lua.org/work/doc/manual.html#8.2 - recommendation "require external library" or use new built-ins

Contributor

mattsta commented Nov 14, 2014

1662 looks also good but the problem is if we should instead go for the Lua 5.2 nowaday standard API.

They were actually added to Lua 5.2 then removed in Lua 5.3. The bitops package is the recommended thing to use across all versions. :)

Added to 5.2: http://www.lua.org/manual/5.2/readme.html#changes
Removed in 5.3: http://www.lua.org/work/doc/manual.html#8.2 - recommendation "require external library" or use new built-ins

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Nov 14, 2014

Owner

@mattsta facepalm... thanks for the info, merging both stuff today.

Owner

antirez commented Nov 14, 2014

@mattsta facepalm... thanks for the info, merging both stuff today.

@leonfs

This comment has been minimized.

Show comment
Hide comment
@leonfs

leonfs Nov 14, 2014

Awesome stuff.. I was thinking on the upgrade to 5.2 mostly for the bit operations that includes. If we can use #1662 it's great as well.

leonfs commented Nov 14, 2014

Awesome stuff.. I was thinking on the upgrade to 5.2 mostly for the bit operations that includes. If we can use #1662 it's great as well.

@antirez

This comment has been minimized.

Show comment
Hide comment
@antirez

antirez Nov 14, 2014

Owner

@leonfs Already merged into 2.8, however it will take a few more days to get released, since there are a lot of new stuff and I'm waiting more time for it to get informally tested by users.

Owner

antirez commented Nov 14, 2014

@leonfs Already merged into 2.8, however it will take a few more days to get released, since there are a lot of new stuff and I'm waiting more time for it to get informally tested by users.

@leonfs

This comment has been minimized.

Show comment
Hide comment
@leonfs

leonfs Nov 14, 2014

@antirez Sure.. makes sense. I've been using http://luaforge.net/projects/bit/ as bit operations, but is a lua script not a compiled operation so the performance is not as great. I can wait, thks again.

leonfs commented Nov 14, 2014

@antirez Sure.. makes sense. I've been using http://luaforge.net/projects/bit/ as bit operations, but is a lua script not a compiled operation so the performance is not as great. I can wait, thks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment