Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Support for scripting language: Lua #673
While I think #672's vision of creating a brand new, game oriented scripting language is both admirable and exciting, it's undoubtedly a long-term project, and won't benefit anyone in the short term. There's also a lot of experience to be had from making an existing scripting language work well with Rust/Piston, and using it to facilitate game development.
I suggest using Lua. It's a very popular scripting language in game development, and there are already two Rust implementations for it:
Perhaps @tomaka would be interested in helping this along?
I can help, but I don't really know what and how it should be integrated in piston.
Note that for the moment rust-hl-lua (my library) doesn't compile because of a regression in the rust compiler. It's also missing some features because I encounter a lot of ICEs when I work on it (at one point I reported three new ICEs in two days).
As far as I am concerned, a scripting language will always deal with game logic, and the only kind of "scripting" you can do with game logic in Piston is AI behavior trees with piston-event, which are generic and integrated with the event model (it is optional). At the moment, it is not possible to integrate Rust generics with a script language. If we were to use a script language, like Lua, as part of some Piston library, then it would be a special library.
The use case for scripting language is usually to give end users scripting capabilities for a binary, like a game editor, where you want fast iterations. It is not that useful for libraries, because 1) using one language makes it easier to refactor and 2) it requires a lower learning curve to use one language. I remember when you had to learn Bash and Make to do anything more than trivial Rust project. All I know of Bash is only because I wanted to use Rust.
My idea of a scripting language is mostly an attempt to understand the principles of type checking. It is not something I plan to use instead of Rust. I prefer to share code using one language due to the amount of time it takes to maintain stuff.
There is another use case of "scripting": Expression based programming. In a this case it matters more that you can reflect upon the language and do lazy optimization. I have worked quite a bit with this, but since I ran into some troubles with change of state over time, which inspired my interest in AI behavior trees.
What we could do is trying to make a small game engine based on some fixed setup of Piston libraries, and try to make it as extensible as possible through a scripting language. For example, with Lua it might look like Love2D. However, I do not plan to work on this, since I prefer static type checking. If anyone are interested in working on this, I will help setup a new project.