porting prosody to Lua 5.2

166 views
Skip to first unread message

Alexandre Skyrme

unread,
Dec 13, 2011, 6:09:24 PM12/13/11
to proso...@googlegroups.com
greetings,

i'm studying the new experimental generational mode for garbage collection
available in lua 5.2. more specifically, i'm interested in observing how
it behaves and how it compares to the standard gc mode.

in order to do so, i'm looking for "real-world" programs developed in lua
that could be used to test the gc in real execution scenarios. ideal
candidates are long running programs that create and destroy lots of
objects throughout their execution.

someone over at the lua list (lua-l) suggested prosody, which i am looking
into. i understand it is not currently compatible with lua 5.2, but what
i'd like to know is: (1) are there any plans to port it to lua 5.2
currently underway and (2) how hard would it be to get rid, or at least to
work around, the setfenv/getfenv calls throughout prosody (as those are no
longer supported in lua 5.2)?

thank you in advance for any insight.

regards,
--alexandre


Waqas Hussain

unread,
Dec 13, 2011, 6:38:15 PM12/13/11
to proso...@googlegroups.com
On Wed, Dec 14, 2011 at 4:09 AM, Alexandre Skyrme
<ask...@inf.puc-rio.br> wrote:
> greetings,
>
> i'm studying the new experimental generational mode for garbage collection
> available in lua 5.2. more specifically, i'm interested in observing how
> it behaves and how it compares to the standard gc mode.
>

The generational GC interests us a lot.

> in order to do so, i'm looking for "real-world" programs developed in lua
> that could be used to test the gc in real execution scenarios. ideal
> candidates are long running programs that create and destroy lots of
> objects throughout their execution.
>

Indeed, Prosody fits that description perfectly.

> someone over at the lua list (lua-l) suggested prosody, which i am looking
> into. i understand it is not currently compatible with lua 5.2, but what
> i'd like to know is: (1) are there any plans to port it to lua 5.2
> currently underway and (2) how hard would it be to get rid, or at least to
> work around, the setfenv/getfenv calls throughout prosody (as those are no
> longer supported in lua 5.2)?
>

Prosody running on 5.2 is certainly desirable. 5.1 is likely to be
around for quite some time, so for now we'll have to stay compatible
with both 5.1 and 5.2. And then there's LuaJIT.

While some portions of the codebase might require more work than
others, I don't think it would be hard. setfenv/getfenv uses are
fairly limited and localized. The main one is in loading plugins (see
core/modulemanager.lua). Plugins get their own environment, allowing
them to create globals without polluting Prosody's global environment
(which is kept read-only). Other uses of setfenv/getfenv are limited
to debug messages, and loading data and config files (with an empty
environment).

If you plan on working on this, I suggest starting with the util/
directory. Most files in util/ are simple and self-contained, so
should be much easier to work with.

I recommend joining the Prosody chatroom by the way:
http://prosody.im/discuss#chatroom

> thank you in advance for any insight.
>
> regards,
> --alexandre
>

--
Waqas Hussain

Reply all
Reply to author
Forward
0 new messages