this project is deprecated and not supported naymore. At some day, i found Luau project, and understood that everything i was thinking about is already done there in much better way :( Btw, soon i will release minified luau project, that will be easier to build and include in other C++ projects. (i am not sure if it's gonna be headerobly). Luau have similar portablilty that vanilla lua has, also has security things, no IO, SYSTEM and other libs, etc., etc. At least give it a try.
OnlyLua - minified and modified 5.4 lua, only luaCore and minified base libraries.
- no
io
, andos
, libraries, no loadfile/dofile() function by default. - Lua debug is not loaded by default, some unsafe functions was removed
- no dynamic runtime CAPI libraries loading (only basic require)
- DOXYGEN documentation is in progress ._.
- Inspired by minilua, all lua is packed in 2/3 files :
lua.h
- standart lua api +lauxlib.h
andlualib.h
in one filelua.c
- full lua core packed in one file for amalgam compilationlualib.c
- all lua libraries packed into one c file.
- Some small perfomance extensions :
- typenames are GCFIXED now
void lua_pushobjtype(lua_State* L, int idx)
returns it to the stack without expensive string table lookups.
- Some CAPI/lua baselib useful but not very compatible changes
- Policy system see luapolicy.h
this project is still in development. If you have some issues - please send them to the issues
on the GitHub page with this repository : link
This is a good base for your own standard lua library, or for embendding lua in trully safe or fast manner. (how i planned to use this)
get/setmetatable
is allowed ONLY for the tables.type()
now will return__name
field in metatable (if exists)rawtype()
works like original type- removed strange (at my opinion) extensions in baselib
- some functions was simplified
- some functions was rewrited on lua itself (
require
) table.new()
function - create table with specified hash and array lengthtable.clear()
function - cleanups table in fastest way possible
see lextensions.c
file for them.
- Remember to follow lua licensing terms : LICENSE.
- (Optional) Install lua (if you want to have possibility to rebuild
lua.c
andlua.h
) - (Optional) Change some luaconf.h flags for your purposes, and in
source
directory runlua make.lua
, to build your customizedlua.c
andlua.h
:) - Copy
lua.h
andlua.c
to the your project - Enjoy :D
WARNING this packing of lua sources breaks compability with C++! be careful, and build lua.c with c compiler, and nothing more!
-
WARNING : AVOID USAGE OF -fanalyzer compiler flag ON DEVICES WITH LESS THAN 4-6 GIGS OF RAM!
-
TODO Need to make doxygen documentation for CAPI and custom baselib :)
-
TODO test custom extensions a bit more...
-
ISSUE this packed lua version is not very
c++-compat
. Some fixes are required. -
TODO remove locale and stdio dependency!
-
TODO Add police system checks in libs
-
TODO fix copyrights, optimize some libraries code
-
TODO Implement custom internal block allocator for GC objects
-
HELPFUL TIP Compile your project and lua sources with -flto and -O2/-O3! It becomes really faster.
It's not very recommended to do that... But... Here is :
- Make sure lua and Gnu Make is installed and acessable in your system.
cd
into the root directory of this repository, and runmake
- You will see some errors from
make.lua
about not foundedstdint.h
,string.h
and etc. - that's ok :) - At the end you will see
luatest
in the root of the repository. - You can run example with lua file in argument, to test... something :)
- use same makefile
- install
x86-64-w64-mingw32
compiler - run
make TARGET=Windows_NT
WARNING! BUILDING FROM WINDOWS TO UNIX IS NOT IMPLEMENTED!