# Runtime Script Interpreter for Lua Alternative

**URL:** https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121
**Category:** Scripting
**Tags:** Scripting
**Created:** [January 27, 2015, 8:33pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121 "2015-01-27T20:33:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Fydar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/fydar/32/989649_2.png) [@Fydar](https://discussions.unity.com/u/Fydar)
#### Post date: [January 27, 2015, 8:33pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/1 "2015-01-27T20:33:18Z")

</div>

I am looking for a a runtime script interpreter that I can use and be compatible with Unity. I’m currently investigating Lua Interface and kopiLua, and they seem like solid options, but I am worried about whether Lua is a good language given my requirements. Are there any popular interpreters for object-oriented languages that are compatible with Unity?

---

<div class="post-metadata">

### Author: ![JoeStrout](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joestrout/32/200738_2.png) [@JoeStrout](https://discussions.unity.com/u/JoeStrout)
#### Post date: [January 27, 2015, 9:20pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/2 "2015-01-27T21:20:12Z")

</div>

Lua’s nasty. I’d rather subject my users to JavaScript than subject them to that. And C# might be even better than JavaScript (depending on your user base).

Either of these is quite possible with the built-in stuff. See [this answer](http://answers.unity3d.com/questions/7885/interpret-unityscript-at-runtime.html) for example.

---

<div class="post-metadata">

### Author: ![Fydar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/fydar/32/989649_2.png) [@Fydar](https://discussions.unity.com/u/Fydar)
#### Post date: [January 27, 2015, 9:44pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/3 "2015-01-27T21:44:59Z")

</div>

> [@JoeStrout](#):
>
> Lua’s nasty. I’d rather subject my users to JavaScript than subject them to that. And C# might be even better than JavaScript (depending on your user base).
> 
> Either of these is quite possible with the built-in stuff. See [this answer](http://answers.unity3d.com/questions/7885/interpret-unityscript-at-runtime.html) for example.

Dosn’t that involve the player having to install unity and only work in the editor and unbuilt?

---

<div class="post-metadata">

### Author: ![Kurt-Dekker](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kurt-dekker/32/101578_2.png) [@Kurt-Dekker](https://discussions.unity.com/u/Kurt-Dekker)
#### Post date: [January 27, 2015, 10:46pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/4 "2015-01-27T22:46:09Z")

</div>

Not sure if you’re open to Python, but I did spot this in the Unity Asset store:

> **[Python Interpreter | Integration | Unity Asset Store](https://assetstore.unity.com/packages/tools/integration/python-interpreter-645)**
>
> Use the Python Interpreter from Noam Gat on your next project. Find this integration tool & more on the Unity Asset Store.

I’m a bit biased towards Python for easy implementation of small script tasks, so that might do exactly what you’re after, and be easy to expand and maintain, I’m guessing.

---

<div class="post-metadata">

### Author: ![JoeStrout](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joestrout/32/200738_2.png) [@JoeStrout](https://discussions.unity.com/u/JoeStrout)
#### Post date: [January 27, 2015, 11:05pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/5 "2015-01-27T23:05:47Z")

</div>

> [@Fydar\_1](#):
>
> Dosn’t that involve the player having to install unity and only work in the editor and unbuilt?

No, that’s not it at all. The two techniques mentioned are for compiling code at runtime — loaded from a file, for example, or a GUI element.

---

<div class="post-metadata">

### Author: ![Fydar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/fydar/32/989649_2.png) [@Fydar](https://discussions.unity.com/u/Fydar)
#### Post date: [January 28, 2015, 11:59am UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/6 "2015-01-28T11:59:41Z")

</div>

Woah, I did not expect this much helpful feedback. Thanks JoeStrout and Kurt Dekker. I’m gonna compile the code from a GUI element.

---

<div class="post-metadata">

### Author: ![JoeStrout](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joestrout/32/200738_2.png) [@JoeStrout](https://discussions.unity.com/u/JoeStrout)
#### Post date: [January 28, 2015, 4:01pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/8 "2015-01-28T16:01:14Z")

</div>

Actually, scripting is something I’m thinking a lot about lately… I’m going to need it eventually for mod support in [High Frontier](http://highfrontier.com/), and I’m not particularly satisfied with any of the off-the-shelf options I’ve found.

I may end up rolling my own solution. But if anybody wants to collaborate on that, please PM me.

---

<div class="post-metadata">

### Author: ![Fydar](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/fydar/32/989649_2.png) [@Fydar](https://discussions.unity.com/u/Fydar)
#### Post date: [January 28, 2015, 6:24pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/9 "2015-01-28T18:24:53Z")

</div>

I done research into kopiLua. It works, but Lua as a language suffers for not being hard-typed, and I will need to do a lot of scripting to expose a basic set of functions to the user.

Thanks for your feedback everyone! If you are going to add mod support or anything, kopiLua was easy to implement. Looks confusing at first. Not at all once you begin work in it.

---

<div class="post-metadata">

### Author: ![JoeStrout](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/joestrout/32/200738_2.png) [@JoeStrout](https://discussions.unity.com/u/JoeStrout)
#### Post date: [January 28, 2015, 7:17pm UTC](https://discussions.unity.com/t/runtime-script-interpreter-for-lua-alternative/565121/10 "2015-01-28T19:17:19Z")

</div>

Sounds like a lot of fun. I’m not a big fan of Lua, but for a cool programming game, I’d muscle through it!
