Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Announcements ➜ Lua 5.1.3 DLL released

Lua 5.1.3 DLL released

Postings by administrators only.

Refresh page


Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Sun 03 Feb 2008 10:02 PM (UTC)

Amended on Mon 04 Feb 2008 03:25 AM (UTC) by Nick Gammon

Message
There has been a bug-fix of Lua released. The latest Lua version is now 5.1.3.

Versions 4.03 to 4.21 of MUSHclient were released with Lua 5.1.2.

The changes in Lua 5.1.3 are noted here (that is, the bugs which were in 5.1.2, but not in 5.1.3):

http://www.lua.org/bugs.html#5.1.2

Most of the bug-fixes are fairly obscure, however if you want the latest version of the script engine, simply download this file, unzip it, and replace the lua5.1.dll in your MUSHclient installation directory with the one from the download. There is also a new version of lua5.1.exe for standalone operation, and luac5.1.exe (in a separate download) for pre-compiling.

The DLL has exactly the same name as before, which is required because MUSHclient is linked against the DLL name.

The new version is available at:

http://www.gammon.com.au/files/mushclient/lua5.1_extras/lua5.1.zip

It is 101 Kb in size.

Lua 5.1.3 will be supplied with forthcoming releases (that is, MUSHclient 4.22 onwards).

If you believe that any of the bugs mentioned in the release notes might affect you, you can install the updated DLL on top of any earlier version of MUSHclient that already has lua5.1.dll in the MUSHclient installation directory. Any earlier scripts should continue to work perfectly.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 03 Feb 2008 10:03 PM (UTC)

Amended on Sun 03 Feb 2008 10:34 PM (UTC) by Nick Gammon

Message
The md5sums for the files in the Lua extras directory are now:


fa6515b07b043812d77c9b9dc0ce3f53 *G15_Display.zip
fe8ce7d694fa2cd4229f28165f8629b5 *lua5.1.zip
6bd118222bcf9287f4c8c57f2dd6bd98 *lua5.1_lib.zip
062877fb0aff718f0c0f4fb3e233dae4 *luac5.1.zip
02f70e7e108ebdb7e7276cef27a295ac *luacom.zip
3a5d1c196819d957578f77231070153e *mysql.zip
7ebf3323439afe75d47f565c3a477d0e *odbc.zip
f50a017e6fcbb3a5489623ea9ad4c989 *windows_utils.zip


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 03 Feb 2008 10:09 PM (UTC)

Amended on Sun 03 Feb 2008 10:10 PM (UTC) by Nick Gammon

Message
The differences between the Lua DLL released here, and the standard one from the Lua site are described here:

http://www.gammon.com.au/forum/?id=7795

These are exactly the same differences as in the previous version. Basically some of the compatability options between Lua 5.1 and Lua 5.0 are turned off, as the Lua developers themselves recommend. Also, 64-bit arithmetic is used in some places instead of 32-bit arithmetic. This only applies to the use of string.format with a %i or %d formatting sequence.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 03 Feb 2008 10:38 PM (UTC)

Amended on Sun 03 Feb 2008 10:41 PM (UTC) by Nick Gammon

Message
There was a problem with my initial release of these zip files about half an hour ago. If you downloaded them immediately the announcement was made you would get an error trying to use the DLL in MUSHclient, due to the fact I misread my own instructions for building the Lua DLL. Specifically, in the file luaconf.h should have been the line:


#define LUA_COMPAT_OPENLIB


If you have the wrong version you will get an error message about not finding an entry point for "luaL_openlib" in the DLL. This has now been corrected.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 03 Feb 2008 10:49 PM (UTC)
Message
A quick way of testing if you have the latest version of the Lua DLL is to test the erroneous handling of deleting table entries which are out-of-bounds, which existed in Lua 5.1.2:


a = {1,2,3}
table.remove(a, 4)
print(a[3])   --> nil   (should be 3)


If the test prints nil, you have version 5.1.2. If it prints 3 you have version 5.1.3 (onwards).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #5 on Wed 27 Feb 2008 09:18 PM (UTC)

Amended on Wed 27 Feb 2008 11:39 PM (UTC) by Nick Gammon

Message
The diffs from the DLL released here (and with MUSHclient) and the absolute standard Lua source is this:


diff src/Makefile ../lua-5.1.3-mushclient/src/Makefile
11c11
< CFLAGS= -O2 -Wall $(MYCFLAGS)
---
> CFLAGS= -O3 -Wall $(MYCFLAGS)
107c107
< 	$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
---
> 	$(MAKE) "LUA_A=lua5.1.dll" "LUA_T=lua.exe" \
diff src/luaconf.h ../lua-5.1.3-mushclient/src/luaconf.h
336c336
< #define LUA_COMPAT_VARARG
---
> #undef LUA_COMPAT_VARARG
343c343
< #define LUA_COMPAT_MOD
---
> #undef LUA_COMPAT_MOD
351c351
< #define LUA_COMPAT_LSTR		1
---
> #undef LUA_COMPAT_LSTR
358c358
< #define LUA_COMPAT_GFIND
---
> #undef LUA_COMPAT_GFIND
738a739,740
> #define  LUA_USELONGLONG // njg
> 
741c743
< #define LUA_INTFRMLEN		"ll"
---
> #define LUA_INTFRMLEN		"I64"




To compile, I used this:


make "CC=gcc -mno-cygwin" mingw


Basically the changes are:


  • Cranked optimization up from O2 (Optimize even more) to O3 (Optimize yet more).

  • Changed the DLL name to lua5.1.dll (rather than lua51.dll).

  • Turn off some compatability options: LUA_COMPAT_VARARG, LUA_COMPAT_MOD, LUA_COMPAT_LSTR, and LUA_COMPAT_GFIND. The comments in the file luaconf.h suggest turning those off as soon as possible, so I have done that. In other words, I am following the suggestions made by the Lua developers here.

  • Turn on the option LUA_USELONGLONG, and use the appropriate format specifiers, in order to better support conversion from floating point to integers. This particularly applies to the string.format function. In particular, printing a large number works better:

    
    print (string.format ("%d", 2^62)) --> 4611686018427387904
    


    Without LUA_USELONGLONG the largest number you could successfully print would be 2^31 - 1 - that is, 2147483647, rather than 2^62, that is, 4611686018427387904.

    However see http://www.gammon.com.au/forum/?id=8505 - only numbers up to 2^52 can be stored with full precision.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,204 views.

Postings by administrators only.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.