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