Is there any scripting language that is fast, easy to integrate, and well suited for high-level game programming?

Firstly, I know that there are many questions related to this, but none of them seem to have helped me in a particular situation. In particular, lua and python do not fit my needs, as I could hope. Maybe there is no language with my requirements, but before reaching this conclusion, it would be nice to hear a few more opinions. :)

As you might have guessed, I need a language for the game engine that I'm trying to create. The purpose of this game engine is to provide the user with the basic tools for creating a game, while giving her the freedom to create many different types of games.

For this reason, the scripting language must intuitively handle game concepts. Among other things, it should be easy to define many types, subtype them with slightly different properties, query and modify objects dynamically, etc.

In addition, the game developer must be able to handle every situation they encounter in a scripting language. Although basic components, such as rendering and networking, will be implemented in C ++, game engines, such as the rotation of several hundred objects around the planet, will be processed in a scripting language. This means that the scripting language should be insanely fast, the speed of 1/10 C is probably minimal.

Then there is a debugging problem. Information about the function, the stack trace, and the state of the variables in which the error occurred should be available.

Last but not least, this is a one-man project. Even if I wanted to, I just do not have the resources to spend weeks on only glue code. Integrating the language with my project should not be much more complicated than lua integration.

Learning the two proposed languages, lua and python, lua is fast (luajit) and easy to integrate, but its standard debugging tools seem to be missing. To make matters worse, lua by default does not have a type system at all. Of course, you can implement this yourself, but the syntax will always be strange and unintuitive.

Python, on the other hand, is very user friendly and has a basic class system. However, it is not easy to integrate, the paradigm does not really require type checking, and it is definitely not fast enough for more complex games. I would like to once again note that everything will be done in python. I know well that python is likely to be fast enough for 90% of the code.

There is also a Scala, which I have not seen so far. Scala seems to fulfill most of the requirements, but embedding a Java VM with C doesn't seem very simple, and it usually seems like java expects you to build an application around java, and not vice versa. I'm also not sure if the Scala functional paradigm would be good for the intuitive development of the game.

EDIT: Please note that this question is not about finding a solution at all costs. If there is no language better than lua, I will just compromise and use it (I already have a related thing in my program). I just want to make sure that I did not miss something that would be more suitable before doing this, since Lua is far from the ideal solution for me.

+4
source share
4 answers

Since no one seems to know the combination better than lua / lujit, I think I will stay with that. Thank you all for this. I personally think that Lua really lacks a high-level language for gaming programming, but this is probably the best choice. So for those who find this question and have the same requirements (fast, easy to use, easy to integrate), you will either have to use lua / luajit or make your own. :)

+1
source

You may consider mono . I know only one success story for this approach, but it is big: C ++ - the engine with a mono script - this is the approach adopted by Unity .

+2
source

For embedding, you can look into Tcl , or if you are in a Schema, check out SIOD or Guile . Of course, I would suggest Lua or Python in general, but your question excludes them.

+1
source

Try using the Ring programming language http://ring-lang.net

This scripting language is a general-purpose multi-paradigm language that can be built into C / C ++ projects, expanded using C / C ++ code and / or used as a stand-alone language. Supported programming paradigms are imperative, procedural, object-oriented, functional, meta-programming, declarative programming using nested structures and natural programming.

The language is simple, it tries to be natural, to encourage organization and provides transparent implementation. It comes with compact syntax and a group of functions that allow the programmer to create natural domain-specific interfaces and declarative languages ​​in seconds. It is very small, fast, and comes with an intelligent garbage collector that puts memory under the control of a programmer. It supports many programming paradigms, comes with useful and practical libraries. The language is designed to increase productivity and develop high-quality solutions that can scale.

Compiler + Virtual Machine - 15,000 lines of C code

Embedding Ring Interpreter in C / C ++ programs https://en.wikibooks.org/wiki/Ring/Lessons/Embedding_Ring_Interpreter_in_C/C%2B%2B_Programs

+1
source

All Articles