This repository provides scripts and tools to compile the Lua runtime and generate Lua bytecode for embedding in the MultiReplace plugin (see notepadpp-multireplace).
By precompiling Lua scripts, this setup enhances execution speed and security by embedding the bytecode directly into the plugin, removing the need for external Lua script files.
- Lua Compilation: Scripts to compile
lua.exeandluac.exefor generating Lua bytecode. - Automated Bytecode Generation: Converts Lua scripts (
.lua) into bytecode (.luac). - C++ Integration: Generates a
luaEmbedded.hfile containing the compiled bytecode for direct embedding into MultiReplace. - Cross-Platform Compatibility: Works with Windows using Visual Studio 2022.
Run the following command to compile the Lua interpreter and bytecode compiler:
./compile_lua.batConvert the initScript.lua file into Lua bytecode:
./compile_luac.batConvert the compiled bytecode into a C++ header file:
cscript //nologo convert_luac.vbsAlternatively, execute the full build process in one step:
./run_all.batThe Lua directory can be set as a parameter when running run_all.bat. If no path is specified, the default lua-5.4.6 directory is used.
Example usage:
./run_all.bat lua-5.4.6initScript.luac→ Compiled Lua bytecodeluaEmbedded.h→ C++ header containing bytecode and source