cosmopolitan/third_party/lua
Justine Tunney 791f79fcb3
Make improvements
- We now serialize the file descriptor table when spawning / executing
  processes on Windows. This means you can now inherit more stuff than
  just standard i/o. It's needed by bash, which duplicates the console
  to file descriptor #255. We also now do a better job serializing the
  environment variables, so you're less likely to encounter E2BIG when
  using your bash shell. We also no longer coerce environ to uppercase

- execve() on Windows now remotely controls its parent process to make
  them spawn a replacement for itself. Then it'll be able to terminate
  immediately once the spawn succeeds, without having to linger around
  for the lifetime as a shell process for proxying the exit code. When
  process worker thread running in the parent sees the child die, it's
  given a handle to the new child, to replace it in the process table.

- execve() and posix_spawn() on Windows will now provide CreateProcess
  an explicit handle list. This allows us to remove handle locks which
  enables better fork/spawn concurrency, with seriously correct thread
  safety. Other codebases like Go use the same technique. On the other
  hand fork() still favors the conventional WIN32 inheritence approach
  which can be a little bit messy, but is *controlled* by guaranteeing
  perfectly clean slates at both the spawning and execution boundaries

- sigset_t is now 64 bits. Having it be 128 bits was a mistake because
  there's no reason to use that and it's only supported by FreeBSD. By
  using the system word size, signal mask manipulation on Windows goes
  very fast. Furthermore @asyncsignalsafe funcs have been rewritten on
  Windows to take advantage of signal masking, now that it's much more
  pleasant to use.

- All the overlapped i/o code on Windows has been rewritten for pretty
  good signal and cancelation safety. We're now able to ensure overlap
  data structures are cleaned up so long as you don't longjmp() out of
  out of a signal handler that interrupted an i/o operation. Latencies
  are also improved thanks to the removal of lots of "busy wait" code.
  Waits should be optimal for everything except poll(), which shall be
  the last and final demon we slay in the win32 i/o horror show.

- getrusage() on Windows is now able to report RUSAGE_CHILDREN as well
  as RUSAGE_SELF, thanks to aggregation in the process manager thread.
2023-10-08 08:59:53 -07:00
..
test Make fixes and improvements 2023-07-09 05:21:11 -07:00
cosmo.h Make improvements 2023-09-06 12:34:59 -07:00
lapi.c Fix bugs in cosmocc toolchain 2023-06-08 23:44:03 -07:00
lapi.h Make improvements 2022-04-24 10:06:05 -07:00
lauxlib.c Unbloat the build 2022-08-11 00:15:29 -07:00
lauxlib.h Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
lbaselib.c Unbloat the build 2022-08-11 00:15:29 -07:00
lcode.c Make improvements 2022-04-24 10:06:05 -07:00
lcode.h Make improvements 2022-04-24 10:06:05 -07:00
lcorolib.c Make improvements 2022-04-24 10:06:05 -07:00
lctype.h Polish redbean serialization 2022-04-29 06:10:10 -07:00
ldblib.c Unbloat the build 2022-08-11 00:15:29 -07:00
ldebug.c Unbloat the build 2022-08-11 00:15:29 -07:00
ldebug.h Make improvements 2022-04-24 10:06:05 -07:00
ldo.c Make improvements for Actually Portable Emacs 2023-08-19 06:44:58 -07:00
ldo.h Make improvements 2022-04-24 10:06:05 -07:00
ldump.c Make improvements 2022-04-24 10:06:05 -07:00
lfunc.c Make improvements 2022-04-24 10:06:05 -07:00
lfunc.h Make improvements 2022-04-24 10:06:05 -07:00
lgc.c Unbloat the build 2022-08-11 00:15:29 -07:00
lgc.h Make improvements 2022-04-24 10:06:05 -07:00
linit.c Make improvements 2022-04-24 10:06:05 -07:00
liolib.c Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
ljumptab.inc Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
llex.c Add EncodeHex() and DecodeHex() to Redbean 2023-07-06 15:38:08 -07:00
llex.h Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
llimits.h Make improvements 2022-04-26 16:46:15 -07:00
llock.c Make important improvements 2022-09-14 22:39:08 -07:00
lmathlib.c Clean up more code 2023-06-18 01:00:05 -07:00
lmem.c Add raw memory visualization tool to redbean 2022-05-14 04:33:58 -07:00
lmem.h Make improvements 2022-04-24 10:06:05 -07:00
loadlib.c Unbloat the build 2022-08-11 00:15:29 -07:00
lobject.c Unbloat the build 2022-08-11 00:15:29 -07:00
lobject.h Pay off more technical debt 2022-09-12 23:36:56 -07:00
lopcodes.c Make improvements 2022-04-24 10:06:05 -07:00
lopcodes.h Make improvements 2022-04-24 10:06:05 -07:00
lopnames.inc Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
loslib.c Make improvements 2023-09-18 21:04:47 -07:00
lparser.c Unbloat the build 2022-08-11 00:15:29 -07:00
lparser.h Make improvements 2022-04-24 10:06:05 -07:00
lprefix.h Make improvements 2022-04-24 10:06:05 -07:00
lrepl.c Implement basic canonical mode for Windows 2023-10-03 22:36:22 -07:00
lrepl.h Remove IMAGE_BASE_VIRTUAL 2023-09-12 01:21:36 -07:00
lstate.c Unbloat the build 2022-08-11 00:15:29 -07:00
lstate.h Make improvements 2022-04-24 10:06:05 -07:00
lstring.c Unbloat the build 2022-08-11 00:15:29 -07:00
lstring.h Make improvements 2022-04-24 10:06:05 -07:00
lstrlib.c Unbloat the build 2022-08-11 00:15:29 -07:00
ltable.c Make improvements 2022-04-24 10:06:05 -07:00
ltable.h Make improvements 2022-04-24 10:06:05 -07:00
ltablib.c Clean up more code 2023-06-18 01:00:05 -07:00
ltests.c Make improvements 2022-04-27 05:39:39 -07:00
ltests.h Make improvements 2022-04-24 10:06:05 -07:00
ltm.c Make improvements 2022-04-24 10:06:05 -07:00
ltm.h Make improvements 2022-04-24 10:06:05 -07:00
lua.h Revert adding lua array per discussion in #222 (#229) 2021-08-07 15:20:33 -07:00
lua.main.c Reduce mandatory stack rss by 256kb 2023-09-07 04:33:01 -07:00
lua.mk Make improvements 2023-09-18 21:04:47 -07:00
luac.main.c Reduce mandatory stack rss by 256kb 2023-09-07 04:33:01 -07:00
luacallwithtrace.c Update redbean to stringify error objects (#393) 2022-04-25 21:14:36 -07:00
luaconf.h Make the Windows Console work better 2023-09-07 18:27:22 -07:00
luaencodejsondata.c Fix warnings 2023-09-01 20:50:18 -07:00
luaencodeluadata.c Fix warnings 2023-09-01 20:50:18 -07:00
luaencodeurl.c Fix warnings 2023-09-01 20:50:18 -07:00
luaformatstack.c Make improvements 2023-09-06 12:34:59 -07:00
lualib.h Make improvements 2022-04-24 10:06:05 -07:00
luaparseurl.c Improve redbean method=get parameter handling 2022-09-19 20:04:39 -07:00
luaprintstack.c Unbloat the build 2022-08-11 00:15:29 -07:00
luapushheader.c Fix warnings 2023-09-01 20:50:18 -07:00
luapushheaders.c Unbloat the build 2022-08-11 00:15:29 -07:00
luapushlatin1.c Trim down redbean a little bit 2022-03-21 19:32:30 -07:00
luapushurlparams.c Trim down redbean a little bit 2022-03-21 19:32:30 -07:00
lundump.c Unbloat the build 2022-08-11 00:15:29 -07:00
lundump.h Make improvements 2022-04-24 10:06:05 -07:00
lunix.c Make improvements 2023-10-08 08:59:53 -07:00
lunix.h Make improvements 2022-07-21 03:36:42 -07:00
lutf8lib.c Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
lvm.c Unbloat the build 2022-08-11 00:15:29 -07:00
lvm.h Make improvements 2022-04-24 10:06:05 -07:00
lzio.c Unbloat the build 2022-08-11 00:15:29 -07:00
lzio.h Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
README.cosmo Write more redbean unit tests 2022-07-08 23:10:02 -07:00
serialize.c Introduce #include <cosmo.h> to toolchain users 2023-06-09 18:03:05 -07:00
tms.h Add Lua compiler 2021-08-09 13:09:14 -07:00
visitor.c Further improve JSON serialization 2022-07-11 23:06:49 -07:00
visitor.h Further improve JSON serialization 2022-07-11 23:06:49 -07:00

DESCRIPTION

  Lua is a language designed for embedded use in native applications. It
  has an impossibly elegant C API and the Lua language itself feels more
  like Python compared to alternatives like Tcl except it's a great deal
  faster and doesn't have strong opinions about character encoding.

PROVENANCE

  https://github.com/lua/lua/

  commit e7803f7dbcdc966ab1f9db143424ee811ab1a398
  Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
  Date:   Wed Mar 3 09:44:20 2021 -0300

      New release number (5.4.3)

  luac.c needed to be sourced from:
  https://www.lua.org/ftp/lua-5.4.3.tar.gz

LOCAL MODIFICATIONS

  Lua now uses a bestline REPL with bash-style code completion.

  Integer literals such as `033` will now be interpreted as octal.

  Integer literals such as `0b10` will now be interpreted as binary.

  The `\e` string literal escape sequence has been added, which is
  equivalent to `\27` (the Lua version of `\033`) or the ASCII ESC
  character. It may be used for teletypewriter control like having
  bold text, which can be encoded elegantly as `\e[1mHELLO\e[0m`.

  Added luaL_traceback2() for function parameters in traceback.

  Added Python-like printf modulus operator for strings.

  Added Python-like printf multiply operator for strings.