{"id":25738349,"url":"https://github.com/kunitoki/luabridge3","last_synced_at":"2025-04-05T04:08:19.346Z","repository":{"id":41906000,"uuid":"314220578","full_name":"kunitoki/LuaBridge3","owner":"kunitoki","description":"A lightweight, dependency-free library for binding Lua to C++","archived":false,"fork":false,"pushed_at":"2024-09-30T06:26:39.000Z","size":4514,"stargazers_count":283,"open_issues_count":12,"forks_count":41,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T03:01:48.180Z","etag":null,"topics":["bindings","cpp","cpp17","lua","luajit"],"latest_commit_sha":null,"homepage":"https://kunitoki.github.io/LuaBridge3/Manual","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kunitoki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-19T11:00:20.000Z","updated_at":"2025-03-28T21:01:30.000Z","dependencies_parsed_at":"2025-02-26T07:30:17.624Z","dependency_job_id":"87e65dc3-226f-41a0-a3d4-48633b355a6b","html_url":"https://github.com/kunitoki/LuaBridge3","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitoki%2FLuaBridge3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitoki%2FLuaBridge3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitoki%2FLuaBridge3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitoki%2FLuaBridge3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunitoki","download_url":"https://codeload.github.com/kunitoki/LuaBridge3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284941,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","cpp","cpp17","lua","luajit"],"created_at":"2025-02-26T07:30:04.865Z","updated_at":"2025-04-05T04:08:19.297Z","avatar_url":"https://github.com/kunitoki.png","language":"C","readme":"\u003ca href=\"https://kunitoki.github.io/LuaBridge3\"\u003e\n\u003cimg height=\"118\" src=\"https://github.com/kunitoki/LuaBridge3/blob/master/logo.png?raw=true\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://lua.org\"\u003e\n\u003cimg height=\"118\" src=\"https://github.com/kunitoki/LuaBridge3/blob/master/lua.png?raw=true\"\u003e\n\u003c/a\u003e\n\u003cbr\u003e\n\n# LuaBridge 3.0\n\n[LuaBridge3](https://github.com/kunitoki/LuaBridge3) is a lightweight and dependency-free library for mapping data,\nfunctions, and classes back and forth between C++ and [Lua](http://wwww.lua.org) (a powerful,\nfast, lightweight, embeddable scripting language). LuaBridge has been tested\nand works with Lua 5.1.5, 5.2.4, 5.3.6 and 5.4.6 as well as [LuaJit](https://luajit.org/) 2.x onwards\nand for the first time also with [Luau](https://luau-lang.org/) 0.556 onwards and [Ravi](https://github.com/dibyendumajumdar/ravi) 1.0-beta11.\n\n## Features\n\nLuaBridge3 is usable from a compliant C++17 compiler and offers the following features:\n\n* [MIT Licensed](https://www.opensource.org/licenses/mit-license.html), no usage restrictions!\n* Headers-only: No Makefile, no .cpp files, just one `#include` and one header file (optional) !\n* Works with ANY lua version out there (PUC-Lua, LuaJIT, Luau, Ravi, you name it).\n* Simple, light, and nothing else needed.\n* Fast to compile (even in release mode), scaling linearly with the size of your binded code.\n* No macros, settings, or configuration scripts needed.\n* Supports different object lifetime management models.\n* Convenient, type-safe access to the Lua stack.\n* Automatic function parameter type binding.\n* Functions and constructors overloading support.\n* Easy access to Lua objects like tables and functions.\n* Expose C++ classes allowing them to use the flexibility of lua property lookup.\n* Interoperable with most common c++ standard library container types.\n* Written in a clear and easy to debug style.\n\n## Improvements Over Vanilla LuaBridge\n\nLuaBridge3 offers a set of improvements compared to vanilla LuaBridge:\n\n* The only binder library that works with PUC-Lua as well as LuaJIT, Luau and Ravi, wonderful for game development !\n* Can work with both c++ exceptions and without (Works with `-fno-exceptions` and `/EHsc-`).\n* Can safely register and use classes exposed across shared library boundaries.\n* Full support for capturing lambdas in all namespace and class methods.\n* Overloaded function support in Namespace functions, Class constructors, functions and static functions.\n* Supports placement allocation or custom allocations/deallocations of C++ classes exposed to lua.\n* Lightweight object creation: allow adding lua tables on the stack and register methods and metamethods in them.\n* Allows for fallback `__index` and `__newindex` metamethods in exposed C++ classes, to support flexible and dynamic C++ classes !\n* Added `std::shared_ptr` to support shared C++/Lua lifetime for types deriving from `std::enable_shared_from_this`.\n* Supports conversion to and from `std::nullptr_t`, `std::byte`, `std::pair`, `std::tuple` and `std::reference_wrapper`.\n* Supports conversion to and from C style arrays of any supported type.\n* Transparent support of all signed and unsigned integer types up to `int64_t`.\n* Consistent numeric handling and conversions (signed, unsigned and floats) across all lua versions.\n* Simplified registration of enum types via the `luabridge::Enum` stack wrapper.\n* Opt-out handling of safe stack space checks (automatically avoids exhausting lua stack space when pushing values!).\n\n## Status\n\n![Build MacOS](https://github.com/kunitoki/LuaBridge3/workflows/Build%20MacOS/badge.svg?branch=master)\n![Build Windows](https://github.com/kunitoki/LuaBridge3/workflows/Build%20Windows/badge.svg?branch=master)\n![Build Linux](https://github.com/kunitoki/LuaBridge3/workflows/Build%20Linux/badge.svg?branch=master)\n\n## Code Coverage\n[![Coverage Status](https://coveralls.io/repos/github/kunitoki/LuaBridge3/badge.svg?branch=master\u0026kill_cache=1)](https://coveralls.io/github/kunitoki/LuaBridge3?branch=master)\n\n## Documentation\n\nPlease read the [LuaBridge3 Reference Manual](https://kunitoki.github.io/LuaBridge3/Manual) for more details on the API.\n\n## Release Notes\n\nPlase read the [LuaBridge3 Release Notes](https://kunitoki.github.io/LuaBridge3/CHANGES) for more details\n\n## Installing LuaBridge3 (vcpkg)\n\nYou can download and install LuaBridge3 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:\n```Powershell or bash\ngit clone https://github.com/Microsoft/vcpkg.git\ncd vcpkg\n./bootstrap-vcpkg.sh # The name of the script should be \"./bootstrap-vcpkg.bat\" for Powershell\n./vcpkg integrate install\n./vcpkg install luabridge3\n```\n\nThe LuaBridge3 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\n\n### Update vcpkg\n\nTo update the vcpkg port, we need to know the hash of the commit and the sha512 of its downloaded artifact.\nStarting from the commit hash that needs to be published, download the archived artifact and get the sha512 of it:\n\n```bash\nCOMMIT_HASH=\"0e17140276d215e98764813078f48731125e4784\"\n\nwget https://github.com/kunitoki/LuaBridge3/archive/${COMMIT_HASH}.tar.gz\n\nshasum -a 512 ${COMMIT_HASH}.tar.gz\n# fbdf09e3bd0d4e55c27afa314ff231537b57653b7c3d96b51eac2a41de0c302ed093500298f341cb168695bae5d3094fb67e019e93620c11c7d6f8c86d3802e2 0e17140276d215e98764813078f48731125e4784.tar.gz\n```\nNow update the version in https://github.com/microsoft/vcpkg/blob/master/ports/luabridge3/vcpkg.json and the commit hash and sha512 in https://github.com/microsoft/vcpkg/blob/master/ports/luabridge3/portfile.cmake then commit the changes.\nEnter into vcpkg folder and issue:\n\n```bash\n./vcpkg x-add-version --all\n```\n\nCommit the changed files and create a Pull Request for vcpkg.\n\n## Unit Tests\n\nUnit test build requires a CMake and C++17 compliant compiler.\n\nThere are 11 unit test flavors:\n* `LuaBridgeTests51` - uses Lua 5.1\n* `LuaBridgeTests51Noexcept` - uses Lua 5.1 without exceptions enabled\n* `LuaBridgeTests52` - uses Lua 5.2\n* `LuaBridgeTests52Noexcept` - uses Lua 5.2 without exceptions enabled\n* `LuaBridgeTests53` - uses Lua 5.3\n* `LuaBridgeTests53Noexcept` - uses Lua 5.3 without exceptions enabled\n* `LuaBridgeTests54` - uses Lua 5.4\n* `LuaBridgeTests54Noexcept` - uses Lua 5.4 without exceptions enabled\n* `LuaBridgeTestsLuaJIT` - uses LuaJIT 2.1\n* `LuaBridgeTestsLuaJITNoexcept` - uses LuaJIT 2.1 without exceptions enabled\n* `LuaBridgeTestsLuau` - uses Luau\n* `LuaBridgeTestsRavi` - uses Ravi\n\n(Luau compiler needs exceptions, so there are no test targets on Luau without exceptions)\n(Ravi doesn't fully work without exceptions, so there are no test targets on Ravi without exceptions)\n\nGenerate Unix Makefiles and build on Linux:\n```bash\ngit clone --recursive git@github.com:kunitoki/LuaBridge3.git\n\nmkdir -p LuaBridge3/build\npushd LuaBridge3/build\ncmake -G \"Unix Makefiles\" ../\ncmake --build . -DCMAKE_BUILD_TYPE=Debug\n# or cmake --build . -DCMAKE_BUILD_TYPE=Release\n# or cmake --build . -DCMAKE_BUILD_TYPE=RelWithDebInfo\npopd\n```\n\nGenerate XCode project and build on MacOS:\n```bash\ngit clone --recursive git@github.com:kunitoki/LuaBridge3.git\n\nmkdir -p LuaBridge3/build\npushd LuaBridge3/build\ncmake -G Xcode ../ # Generates XCode project build/LuaBridge.xcodeproj\ncmake --build . -DCMAKE_BUILD_TYPE=Debug\n# or cmake --build . -DCMAKE_BUILD_TYPE=Release\n# or cmake --build . -DCMAKE_BUILD_TYPE=RelWithDebInfo\npopd\n```\n\nGenerate VS2019 solution on Windows:\n```cmd\ngit clone --recursive git@github.com:kunitoki/LuaBridge3.git\n\nmkdir LuaBridge3/build\npushd LuaBridge3/build\ncmake -G \"Visual Studio 16\" ../ # Generates MSVS solution build/LuaBridge.sln\npopd\n```\n\n## Official Repository\n\nLuaBridge3 is published under the terms of the [MIT License](https://www.opensource.org/licenses/mit-license.html).\n\nThe original version of LuaBridge3 was written by Nathan Reed. The project has\nbeen taken over by Vinnie Falco, who added new functionality, wrote the new\ndocumentation, and incorporated contributions from Nigel Atkinson. Then it has\nbeen forked from the original https://github.com/vinniefalco/LuaBridge into its\nown LuaBridge3 repository by Lucio Asnaghi, and development continued there.\n\nFor questions, comments, or bug reports feel free to open a Github issue\nor contact Lucio Asnaghi directly at the email address indicated below.\n\nCopyright 2020, Lucio Asnaghi (\u003ckunitoki@gmail.com\u003e)\u003cbr\u003e\nCopyright 2019, Dmitry Tarakanov\u003cbr\u003e\nCopyright 2012, Vinnie Falco (\u003cvinnie.falco@gmail.com\u003e)\u003cbr\u003e\nCopyright 2008, Nigel Atkinson\u003cbr\u003e\nCopyright 2007, Nathan Reed\u003cbr\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunitoki%2Fluabridge3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunitoki%2Fluabridge3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunitoki%2Fluabridge3/lists"}