LuaGlobal Improvements - help needed

lex
Posts: 55
Joined: Fri May 14, 2010 2:28 pm

LuaGlobal Improvements - help needed

Post by lex »

Hi,

I did have a quick look at LuaGlobal.lua and I must say that there is a lot of space for improvements. This is good thing, because we can easily make it much better :) (Yes, I am will to do some work if someone will kick in right direction – you know I am not a programmer.)

Mudlet is currently loading 2 files on session start up: db.lua and LuaGlobal.lua. If you look at LuaGlobal.lua you will see that is containing mix of various unsorted helper functions in pretty “random” order. Problems that I have with this are that is very hard to find there anything (same for lua documentation).

I would like to suggest following that will drastically improve situation (if we make it right).
  • split LuaGlobal.lua into few separate files that will hold functions just for specific area (something like StringUtils.lua, TableUtils.lua, GUIUtils.lua, DebugUtils.lua, Others.lua)
  • enforce Geyser style comments/documentation and generate all LUA documentation from it (see example bellow)
    Code: [show] | [select all] lua
    --- Prints a message to the window. All parameters are optional and if not
    -- specified will use the last set value.
    -- @param message The message to print. Can contain html formatting.
    -- @param color The color to use.
    -- @param format A format list to use. 'c' - center, 'b' - bold, 'i' - italics,
    -- 'u' - underline, '##' - font size. For example, "cb18" 
    -- specifies center bold 18pt font be used. Order doesn't matter.
    function Geyser.Label:echo(message, color, format)
    
That's about it. Let me know what do you think about it and how can we make it happen,
Thank you
Lex
Last edited by lex on Mon Jun 14, 2010 9:23 pm, edited 1 time in total.

User avatar
Jules
Posts: 118
Joined: Sun Oct 11, 2009 5:41 pm
Location: Plymouth State University - Sophomore

Re: LuaGlobal Improvements

Post by Jules »

I support this thread.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: LuaGlobal Improvements

Post by Vadi »

I don't see the need for splitting the file.

Changing the documentation to another format won't help it's problem; and that is the quality of it (for me personally, it's the limit of 24h in a day, and redoing it in another format will certainly not help address it). Not against using LuaDoc, but it's a bit pointless.

lex
Posts: 55
Joined: Fri May 14, 2010 2:28 pm

Re: LuaGlobal Improvements

Post by lex »

splitting LuaGlobal file:
* correct me if I am wrong, but I though that this wont be big issue, Mudlet just have to load more files on start up
* you can easily separate non-related functions. This will allow us to have some consistent names and also to reduce code duplicity (currently everyone is just adding useful function randomly into LuaGlobal)
* you already have DB.lua, which is following same idea

LuaDoc:
* How long do you think that you can manage current documentation state. I am willing to put there all hard work in this one and transform current documentation to new standard.
* Surely this is just a begging but it will allow you to have a fresh start, so all new lua functions will have LuaDoc.
* This will not improve doc itself but it will make it more readable and maintainable, so it will be much easier to update it.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: LuaGlobal Improvements

Post by tsuujin »

Documentation is another issue entirely. In order to get it to a standard you'd need to go through and rewrite every single function's documentation tags, and there are more important things that need to be done in Mudlet right now.

I've been a general user of javadoc for a long time, so I'm used to formatting my documentation a certain way. Not everyone is going to agree, and that's another problem.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: LuaGlobal Improvements

Post by Vadi »

Alright, if you'd like to contribute then go ahead. LuaGlobal is stored at http://github.com/babelfish/mudlet-lua/, Babelfish/Denirii is its maintainer - so get in contact with him on irc or here to sort out the code itself, and as for generated documentation, we'll link to it from the general manual then.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: LuaGlobal Improvements

Post by Denarii »

lex wrote:(currently everyone is just adding useful function randomly into LuaGlobal)
No, currently all changes to LuaGlobal go through me. However there is a lot of random stuff in no particular logical order (actually, not true, originally stuff was grouped by the person who contributed it) mainly because I didn't really feel like sorting through it and reordering it in a logical manner after I took over handling it.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: LuaGlobal Improvements

Post by tsuujin »

Denarii wrote:
lex wrote:(currently everyone is just adding useful function randomly into LuaGlobal)
No, currently all changes to LuaGlobal go through me. However there is a lot of random stuff in no particular logical order (actually, not true, originally stuff was grouped by the person who contributed it) mainly because I didn't really feel like sorting through it and reordering it in a logical manner after I took over handling it.
If you want some help with logical ordering, I'm game

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: LuaGlobal Improvements

Post by Heiko »

I've begun work on the next Mudlet update. So it would be the perfect time right now to reorganize and improve LuaGlobal.lua now. Denari/Babelfish is the maintainer. It's best if those who are interested contact him directly by email (->Mudlet About dialog or IRC).

lex
Posts: 55
Joined: Fri May 14, 2010 2:28 pm

Re: LuaGlobal Improvements

Post by lex »

Great I will contact them soon.


My idea was to perform LuaGlobal clean up in following stages:

1. reorder function within LuaGlobal and make sure that's still working (I suppose that we'll sort it to following function groups: StringUtils, TableUtils, GUIUtils, DebugTools, Other - just a suggestion)

2. split LuaGlobal to separate files by functional group and make sure that is still working as whole

3. start to use LuaDoc and convert all documentation to it (ok all API documentation, there still be doc outside that will describe basic concepts and typical usage examples)

4. now we can actually start with new fixes and improvement to code and documentation

Post Reply