1*572c4311SfengbojiangHISTORY for Lua 5.1 2*572c4311Sfengbojiang 3*572c4311Sfengbojiang* Changes from version 5.0 to 5.1 4*572c4311Sfengbojiang ------------------------------- 5*572c4311Sfengbojiang Language: 6*572c4311Sfengbojiang + new module system. 7*572c4311Sfengbojiang + new semantics for control variables of fors. 8*572c4311Sfengbojiang + new semantics for setn/getn. 9*572c4311Sfengbojiang + new syntax/semantics for varargs. 10*572c4311Sfengbojiang + new long strings and comments. 11*572c4311Sfengbojiang + new `mod' operator (`%') 12*572c4311Sfengbojiang + new length operator #t 13*572c4311Sfengbojiang + metatables for all types 14*572c4311Sfengbojiang API: 15*572c4311Sfengbojiang + new functions: lua_createtable, lua_get(set)field, lua_push(to)integer. 16*572c4311Sfengbojiang + user supplies memory allocator (lua_open becomes lua_newstate). 17*572c4311Sfengbojiang + luaopen_* functions must be called through Lua. 18*572c4311Sfengbojiang Implementation: 19*572c4311Sfengbojiang + new configuration scheme via luaconf.h. 20*572c4311Sfengbojiang + incremental garbage collection. 21*572c4311Sfengbojiang + better handling of end-of-line in the lexer. 22*572c4311Sfengbojiang + fully reentrant parser (new Lua function `load') 23*572c4311Sfengbojiang + better support for 64-bit machines. 24*572c4311Sfengbojiang + native loadlib support for Mac OS X. 25*572c4311Sfengbojiang + standard distribution in only one library (lualib.a merged into lua.a) 26*572c4311Sfengbojiang 27*572c4311Sfengbojiang* Changes from version 4.0 to 5.0 28*572c4311Sfengbojiang ------------------------------- 29*572c4311Sfengbojiang Language: 30*572c4311Sfengbojiang + lexical scoping. 31*572c4311Sfengbojiang + Lua coroutines. 32*572c4311Sfengbojiang + standard libraries now packaged in tables. 33*572c4311Sfengbojiang + tags replaced by metatables and tag methods replaced by metamethods, 34*572c4311Sfengbojiang stored in metatables. 35*572c4311Sfengbojiang + proper tail calls. 36*572c4311Sfengbojiang + each function can have its own global table, which can be shared. 37*572c4311Sfengbojiang + new __newindex metamethod, called when we insert a new key into a table. 38*572c4311Sfengbojiang + new block comments: --[[ ... ]]. 39*572c4311Sfengbojiang + new generic for. 40*572c4311Sfengbojiang + new weak tables. 41*572c4311Sfengbojiang + new boolean type. 42*572c4311Sfengbojiang + new syntax "local function". 43*572c4311Sfengbojiang + (f()) returns the first value returned by f. 44*572c4311Sfengbojiang + {f()} fills a table with all values returned by f. 45*572c4311Sfengbojiang + \n ignored in [[\n . 46*572c4311Sfengbojiang + fixed and-or priorities. 47*572c4311Sfengbojiang + more general syntax for function definition (e.g. function a.x.y:f()...end). 48*572c4311Sfengbojiang + more general syntax for function calls (e.g. (print or write)(9)). 49*572c4311Sfengbojiang + new functions (time/date, tmpfile, unpack, require, load*, etc.). 50*572c4311Sfengbojiang API: 51*572c4311Sfengbojiang + chunks are loaded by using lua_load; new luaL_loadfile and luaL_loadbuffer. 52*572c4311Sfengbojiang + introduced lightweight userdata, a simple "void*" without a metatable. 53*572c4311Sfengbojiang + new error handling protocol: the core no longer prints error messages; 54*572c4311Sfengbojiang all errors are reported to the caller on the stack. 55*572c4311Sfengbojiang + new lua_atpanic for host cleanup. 56*572c4311Sfengbojiang + new, signal-safe, hook scheme. 57*572c4311Sfengbojiang Implementation: 58*572c4311Sfengbojiang + new license: MIT. 59*572c4311Sfengbojiang + new, faster, register-based virtual machine. 60*572c4311Sfengbojiang + support for external multithreading and coroutines. 61*572c4311Sfengbojiang + new and consistent error message format. 62*572c4311Sfengbojiang + the core no longer needs "stdio.h" for anything (except for a single 63*572c4311Sfengbojiang use of sprintf to convert numbers to strings). 64*572c4311Sfengbojiang + lua.c now runs the environment variable LUA_INIT, if present. It can 65*572c4311Sfengbojiang be "@filename", to run a file, or the chunk itself. 66*572c4311Sfengbojiang + support for user extensions in lua.c. 67*572c4311Sfengbojiang sample implementation given for command line editing. 68*572c4311Sfengbojiang + new dynamic loading library, active by default on several platforms. 69*572c4311Sfengbojiang + safe garbage-collector metamethods. 70*572c4311Sfengbojiang + precompiled bytecodes checked for integrity (secure binary dostring). 71*572c4311Sfengbojiang + strings are fully aligned. 72*572c4311Sfengbojiang + position capture in string.find. 73*572c4311Sfengbojiang + read('*l') can read lines with embedded zeros. 74*572c4311Sfengbojiang 75*572c4311Sfengbojiang* Changes from version 3.2 to 4.0 76*572c4311Sfengbojiang ------------------------------- 77*572c4311Sfengbojiang Language: 78*572c4311Sfengbojiang + new "break" and "for" statements (both numerical and for tables). 79*572c4311Sfengbojiang + uniform treatment of globals: globals are now stored in a Lua table. 80*572c4311Sfengbojiang + improved error messages. 81*572c4311Sfengbojiang + no more '$debug': full speed *and* full debug information. 82*572c4311Sfengbojiang + new read form: read(N) for next N bytes. 83*572c4311Sfengbojiang + general read patterns now deprecated. 84*572c4311Sfengbojiang (still available with -DCOMPAT_READPATTERNS.) 85*572c4311Sfengbojiang + all return values are passed as arguments for the last function 86*572c4311Sfengbojiang (old semantics still available with -DLUA_COMPAT_ARGRET) 87*572c4311Sfengbojiang + garbage collection tag methods for tables now deprecated. 88*572c4311Sfengbojiang + there is now only one tag method for order. 89*572c4311Sfengbojiang API: 90*572c4311Sfengbojiang + New API: fully re-entrant, simpler, and more efficient. 91*572c4311Sfengbojiang + New debug API. 92*572c4311Sfengbojiang Implementation: 93*572c4311Sfengbojiang + faster than ever: cleaner virtual machine and new hashing algorithm. 94*572c4311Sfengbojiang + non-recursive garbage-collector algorithm. 95*572c4311Sfengbojiang + reduced memory usage for programs with many strings. 96*572c4311Sfengbojiang + improved treatment for memory allocation errors. 97*572c4311Sfengbojiang + improved support for 16-bit machines (we hope). 98*572c4311Sfengbojiang + code now compiles unmodified as both ANSI C and C++. 99*572c4311Sfengbojiang + numbers in bases other than 10 are converted using strtoul. 100*572c4311Sfengbojiang + new -f option in Lua to support #! scripts. 101*572c4311Sfengbojiang + luac can now combine text and binaries. 102*572c4311Sfengbojiang 103*572c4311Sfengbojiang* Changes from version 3.1 to 3.2 104*572c4311Sfengbojiang ------------------------------- 105*572c4311Sfengbojiang + redirected all output in Lua's core to _ERRORMESSAGE and _ALERT. 106*572c4311Sfengbojiang + increased limit on the number of constants and globals per function 107*572c4311Sfengbojiang (from 2^16 to 2^24). 108*572c4311Sfengbojiang + debugging info (lua_debug and hooks) moved into lua_state and new API 109*572c4311Sfengbojiang functions provided to get and set this info. 110*572c4311Sfengbojiang + new debug lib gives full debugging access within Lua. 111*572c4311Sfengbojiang + new table functions "foreachi", "sort", "tinsert", "tremove", "getn". 112*572c4311Sfengbojiang + new io functions "flush", "seek". 113*572c4311Sfengbojiang 114*572c4311Sfengbojiang* Changes from version 3.0 to 3.1 115*572c4311Sfengbojiang ------------------------------- 116*572c4311Sfengbojiang + NEW FEATURE: anonymous functions with closures (via "upvalues"). 117*572c4311Sfengbojiang + new syntax: 118*572c4311Sfengbojiang - local variables in chunks. 119*572c4311Sfengbojiang - better scope control with DO block END. 120*572c4311Sfengbojiang - constructors can now be also written: { record-part; list-part }. 121*572c4311Sfengbojiang - more general syntax for function calls and lvalues, e.g.: 122*572c4311Sfengbojiang f(x).y=1 123*572c4311Sfengbojiang o:f(x,y):g(z) 124*572c4311Sfengbojiang f"string" is sugar for f("string") 125*572c4311Sfengbojiang + strings may now contain arbitrary binary data (e.g., embedded zeros). 126*572c4311Sfengbojiang + major code re-organization and clean-up; reduced module interdependecies. 127*572c4311Sfengbojiang + no arbitrary limits on the total number of constants and globals. 128*572c4311Sfengbojiang + support for multiple global contexts. 129*572c4311Sfengbojiang + better syntax error messages. 130*572c4311Sfengbojiang + new traversal functions "foreach" and "foreachvar". 131*572c4311Sfengbojiang + the default for numbers is now double. 132*572c4311Sfengbojiang changing it to use floats or longs is easy. 133*572c4311Sfengbojiang + complete debug information stored in pre-compiled chunks. 134*572c4311Sfengbojiang + sample interpreter now prompts user when run interactively, and also 135*572c4311Sfengbojiang handles control-C interruptions gracefully. 136*572c4311Sfengbojiang 137*572c4311Sfengbojiang* Changes from version 2.5 to 3.0 138*572c4311Sfengbojiang ------------------------------- 139*572c4311Sfengbojiang + NEW CONCEPT: "tag methods". 140*572c4311Sfengbojiang Tag methods replace fallbacks as the meta-mechanism for extending the 141*572c4311Sfengbojiang semantics of Lua. Whereas fallbacks had a global nature, tag methods 142*572c4311Sfengbojiang work on objects having the same tag (e.g., groups of tables). 143*572c4311Sfengbojiang Existing code that uses fallbacks should work without change. 144*572c4311Sfengbojiang + new, general syntax for constructors {[exp] = exp, ... }. 145*572c4311Sfengbojiang + support for handling variable number of arguments in functions (varargs). 146*572c4311Sfengbojiang + support for conditional compilation ($if ... $else ... $end). 147*572c4311Sfengbojiang + cleaner semantics in API simplifies host code. 148*572c4311Sfengbojiang + better support for writing libraries (auxlib.h). 149*572c4311Sfengbojiang + better type checking and error messages in the standard library. 150*572c4311Sfengbojiang + luac can now also undump. 151*572c4311Sfengbojiang 152*572c4311Sfengbojiang* Changes from version 2.4 to 2.5 153*572c4311Sfengbojiang ------------------------------- 154*572c4311Sfengbojiang + io and string libraries are now based on pattern matching; 155*572c4311Sfengbojiang the old libraries are still available for compatibility 156*572c4311Sfengbojiang + dofile and dostring can now return values (via return statement) 157*572c4311Sfengbojiang + better support for 16- and 64-bit machines 158*572c4311Sfengbojiang + expanded documentation, with more examples 159*572c4311Sfengbojiang 160*572c4311Sfengbojiang* Changes from version 2.2 to 2.4 161*572c4311Sfengbojiang ------------------------------- 162*572c4311Sfengbojiang + external compiler creates portable binary files that can be loaded faster 163*572c4311Sfengbojiang + interface for debugging and profiling 164*572c4311Sfengbojiang + new "getglobal" fallback 165*572c4311Sfengbojiang + new functions for handling references to Lua objects 166*572c4311Sfengbojiang + new functions in standard lib 167*572c4311Sfengbojiang + only one copy of each string is stored 168*572c4311Sfengbojiang + expanded documentation, with more examples 169*572c4311Sfengbojiang 170*572c4311Sfengbojiang* Changes from version 2.1 to 2.2 171*572c4311Sfengbojiang ------------------------------- 172*572c4311Sfengbojiang + functions now may be declared with any "lvalue" as a name 173*572c4311Sfengbojiang + garbage collection of functions 174*572c4311Sfengbojiang + support for pipes 175*572c4311Sfengbojiang 176*572c4311Sfengbojiang* Changes from version 1.1 to 2.1 177*572c4311Sfengbojiang ------------------------------- 178*572c4311Sfengbojiang + object-oriented support 179*572c4311Sfengbojiang + fallbacks 180*572c4311Sfengbojiang + simplified syntax for tables 181*572c4311Sfengbojiang + many internal improvements 182*572c4311Sfengbojiang 183*572c4311Sfengbojiang(end of HISTORY) 184