Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

lua
luac

luacore.h
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======

# Convenience platforms targets.
PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris

# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp luacore.h llimits.h
TO_LIB= liblua.a
TO_MAN= lua.1 luac.1

# Lua version and release.
V= 5.4
R= $V.7
V= 5.5
R= $V.0

# Targets start here.
all: $(PLAT)
Expand Down
6 changes: 0 additions & 6 deletions README

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PUC-Lua with exposed internals

This is a **patched PUC-Lua exposing low-level implementation details**.
This version of Lua is used by some experimental projects including
[Pallene](https://www.github.com/pallene-lang/pallene) and
[LuaAOT](https://github.com/hugomg/lua-aot-5.4).

Use these internal APIs at your own risk!
They are unstable and may change even after a bugfix patch (e.g. 5.4.2 -> 5.4.3).
Additionally, they are unsafe.
You can easily get a segfault or worse if you don't know what you are doing.

# Compiling and installing

Compile and install using the provided Makefile,
the same way you would for upstream PUC-Lua.
Detailed instructions can be found in the doc/readme.html.

# Using

There is a new header file called `luacore.h`,
which contains all the internals APIs from the Lua core (e.g `lgc.h`, `lstring.h`, etc).

There is a new function `luaL_checkcoreversion` in `lauxlib.h`.
It is similar to `luaL_checkversion`, except that also compares the patch number (e.g. 5.4.2 vs 5.4.3).
16 changes: 16 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
How to update to a new Lua release
==================================

1. Switch to upstream branch
2. Replace doc/ src/ and Makefile with the new version
3. Commit and push

4. Switch to main branch
5. Merge and fix conflicts
6. Commit and push

7. git tag {5.x.x}
8. git push origin {5.x.x}

You don't need to manually update luacore.h.
It is automatically generated by the src/Makefile.
Binary file added doc/OSIApproved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/OSIApproved_100X125.png
Binary file not shown.
137 changes: 87 additions & 50 deletions doc/contents.html

Large diffs are not rendered by default.

File renamed without changes
14 changes: 7 additions & 7 deletions doc/lua.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" $Id: lua.man,v 1.14 2024/05/08 18:48:27 lhf Exp $
.TH LUA 1 "$Date: 2024/05/08 18:48:27 $"
.\" $Id: lua.man,v 1.14 2024/03/18 06:57:32 lhf Exp $
.TH LUA 1 "$Date: 2024/03/18 06:57:32 $"
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
Expand Down Expand Up @@ -61,7 +61,7 @@ a syntax error is found.
Before handling command line options and scripts,
.B lua
checks the contents of the environment variables
.B LUA_INIT_5_4
.B LUA_INIT_5_5
and
.BR LUA_INIT ,
in that order.
Expand All @@ -72,7 +72,7 @@ then
is executed.
Otherwise, the contents are assumed to be a Lua statement and is executed.
When
.B LUA_INIT_5_4
.B LUA_INIT_5_5
is defined,
.B LUA_INIT
is ignored.
Expand Down Expand Up @@ -119,14 +119,14 @@ When defined,
the version-specific variants take priority
and the version-neutral variants are ignored.
.TP
.B LUA_INIT, LUA_INIT_5_4
.B LUA_INIT, LUA_INIT_5_5
Code to be executed before command line options and scripts.
.TP
.B LUA_PATH, LUA_PATH_5_4
.B LUA_PATH, LUA_PATH_5_5
Initial value of package.path,
the path used by require to search for Lua loaders.
.TP
.B LUA_CPATH, LUA_CPATH_5_4
.B LUA_CPATH, LUA_CPATH_5_5
Initial value of package.cpath,
the path used by require to search for C loaders.
.SH EXIT STATUS
Expand Down
Loading