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

**URL:** <https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915>\
**Category:** Questions\
**Created:** [May 23, 2016, 4:59pm UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915 "2016-05-23T16:59:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_H](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@Justin\_H](https://forum.defold.com/u/Justin_H)\
**Post date:** [May 23, 2016, 4:59pm UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/1 "2016-05-23T16:59:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [May 23, 2016, 5:55pm UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/2 "2016-05-23T17:55:39Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Justin\_H](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@Justin\_H](https://forum.defold.com/u/Justin_H)\
**Post date:** [May 23, 2016, 6:48pm UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/3 "2016-05-23T18:48:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [May 24, 2016, 7:47am UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/4 "2016-05-24T07:47:16Z")

</div>

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

> **[GitHub - r-lyeh-archived/scriptorium: :scroll: Game Scripting Languages benchmarked](https://github.com/r-lyeh-archived/scriptorium#scriptorium-scroll)**
>
> :scroll: Game Scripting Languages benchmarked

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

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [May 24, 2016, 7:50am UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/5 "2016-05-24T07:50:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 1, 2016, 4:51am UTC](https://forum.defold.com/t/lua-5-1-and-bitwise-operators-def-1742-solved/1915/6 "2016-09-01T04:51:16Z")

</div>

> [@sven](#):
>
> 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)

Fixed in 1.2.87: [Defold 1.2.87 has been released](https://forum.defold.com/t/defold-1-2-87-has-been-released/2766)
