Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indiesoftby/defold-lua51
Enables the vanilla Lua 5.1 interpreter instead of LuaJIT on desktop platforms.
https://github.com/indiesoftby/defold-lua51
defold defold-game-engine defold-module lua luajit
Last synced: about 2 months ago
JSON representation
Enables the vanilla Lua 5.1 interpreter instead of LuaJIT on desktop platforms.
- Host: GitHub
- URL: https://github.com/indiesoftby/defold-lua51
- Owner: indiesoftby
- Created: 2023-10-07T12:13:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-08T10:21:32.000Z (about 1 year ago)
- Last Synced: 2024-10-04T22:08:18.389Z (3 months ago)
- Topics: defold, defold-game-engine, defold-module, lua, luajit
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-defold - Lua51
README
# Lua 5.1 for Defold
A quick way to replace LuaJIT with Lua 5.1 (PUC Rio version, i.e. interpreted) on desktop platforms to run the game as on the Defold HTML5 platform.
## Explanation
Defold aims to keep Lua the same across all platforms, but it currently has a few minor discrepancies in Lua language version between platforms:
| Platform | Lua version | JIT Enabled |
|-----------------|---------------------|-------------|
| Windows | LuaJIT 2.1.0-beta3 | Yes |
| macOS | LuaJIT 2.1.0-beta3 | Yes |
| Linux | LuaJIT 2.1.0-beta3 | Yes |
| Android | LuaJIT 2.1.0-beta3 | Yes |
| iOS | LuaJIT 2.1.0-beta3 | No |
| Nintendo Switch | LuaJIT 2.1.0-beta3 | No |
| **HTML5** | **Lua 5.1.4** | N/A |There is a HUGE performance gap between Lua and LuaJIT. If your primary target development platform is HTML5, it's important to see the actual performance of Lua as if it were running on HTML5 while developing on a PC/Mac/Linux computer.
## Usage
Add this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your `game.project` file and in the dependencies field under project add:
https://github.com/indiesoftby/defold-lua51/archive/main.zip
Check:
```lua
if jit then
-- LuaJIT!
else
-- Lua 5.1!
end
```## Credits
This project is licensed under the terms of the MIT license. The implementation is extracted from the [lmprof](https://github.com/defold/extension-lmprof) extension.