Lua 5.1 and Bitwise Operators (DEF-1742) (SOLVED)

It looks like Defold uses lua 5.1. The problem for me is that lua 5.2 is the first version that offers bitwise operators. Between this and the fact that I can’t add my own C library, I’m starting to feel a bit handcuffed with Defold. For performance purposes, I need to be doing some work at the level of bits and bytes. Any suggestions?

1 Like

We use LuaJIT on most platforms (which include bit operations), and we have an issue to add the bitop library to platforms where we use vanilla Lua (issue DEF-1742).

There is plans to add the possibility of C extensions, but I don’t know when they will be available.

(And hopefully coming in next stable, there is some further optimisations for desktop builds, DEF-1861.)

What areas are you having performance issues with?
LuaJIT is highly performant and the Defold team pour a lot work into the engine itself being high performant as well. :slight_smile:

2 Likes

Thanks. The engine itself does have great performance - that’s one of the things I really like about it! Our studio designs learning and entertainment games around the structure of natural language, so we need to implement various NLP algorithms that are rather computationally expensive.

For what it’s worth, having C extensions would probably make this the go-to engine for us.

5 Likes

In this Game Scripting Languages benchmark you can see performance of LUA:

(As I understand defold use luajit from second place of this table. Am I right?)

2 Likes

This is correct, I’m not sure what is actually tested in those benchmarks though, but LuaJIT is very nice Lua compiler indeed. :slight_smile:

1 Like

Fixed in 1.2.87: Defold 1.2.87 has been released

3 Likes