Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for scripting language: Lua #673

Closed
erlend-sh opened this issue Oct 24, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@erlend-sh
Copy link

commented Oct 24, 2014

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:

https://github.com/tomaka/rust-hl-lua
https://github.com/kballard/rust-lua

Perhaps @tomaka would be interested in helping this along?

@erlend-sh erlend-sh changed the title Support scripting language Lua Support for scripting language: Lua Oct 24, 2014

@tomaka

This comment has been minimized.

Copy link

commented Oct 24, 2014

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

@TyOverby

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2014

I stand behind this fully. I don't know where a scripting language would be used inside of Piston, but Lua is basically the industry standard scripting engine when it comes to game dev.

On top of this, @tomaka has a beautiful library already written.

@AngryLawyer

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2014

As long as it's optional I'm happy. Also, if you do some sort of integration, it'd be nice if it were generic enough to swap out the scripting language (I'm a big fan of Tcl)

@bvssvni

This comment has been minimized.

Copy link
Member

commented Oct 26, 2014

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.

@bvssvni bvssvni added the discussion label Oct 27, 2014

@bvssvni

This comment has been minimized.

Copy link
Member

commented Oct 30, 2014

I think Lua should be actively supported in the ecosystem, but not make it an integrated part of the core libraries. It would be interesting to see some higher level library interop with Lua, but that's another discussion.

Closing.

@bvssvni bvssvni closed this Oct 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.