lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

FWIW, here is a quick summary of what it took to port Nanoki [1] [2], an http and wiki engine implemented in Lua, to 5.2.

In short, it's not too bad :D

% uname -a

Darwin 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386

%  lua -v
Lua 5.2.0 (work1)  Copyright (C) 1994-2008 Lua.org, PUC-Rio


(1) getfenv/setfenv -> debug.getfenv/setfenv 

Pretty straightforward, aside from the fact that the call convention is slightly different between getfenv and debug.getfenv. getfenv was accepting a stack level, debug.getfenv, surprisingly, doesn't, even though most of the other debug function do work in terms of a stack level (e.g. debug.getinfo, etc). Puzzling change altogether.

(2) unpack -> table.unpack

That's pretty much it on the Lua side. 

Here is the change set:

http://dev.alt.textdrive.com/changeset/1589

On the C API side, there are a couple of legacy stuff to cleanup.

(3) luaL_openlib -> luaL_register
(4) luaL_putchar -> luaL_addchar
(5) luaL_typerror -> luaL_typeerror

The above affects libraries such as luasql, luasocket, etc...

(6) The behavior of the new bit library is a bit of a, hmmm, mystery at the moment. Didn't manage to use it as a drop in replacement so far. Needs a bit more investigation.

(7) module still behave has it used to, so no need to change anything there.

(8) Still looking for a meaningful use case for the new 'in' syntax. 

That's all.

Cheers,

PA.





[1] http://alt.textdrive.com/nanoki/
[2] http://dev.alt.textdrive.com/browser/HTTP