Scripting Language

What language for scripting would you recommend learning, I was thinking I might go for Lua but not sure.

I can not see me having an extensive use for it at the moment but it keeps the mind fresh, I am also a big fan of Project Zomboid which is build using LWJGL with heavy Lua script dependencies, this means as I learn a scripting language for my future projects, I can also put it to use in a fun modding environment for my gaming needs :slight_smile:

Input?

JavaScript.

Cas :slight_smile:

Anything the JVM can interprete on its own would be a plus I guess(e.g. JS as princec said), but I really see no benefits with scripting in general (on the JVM).

Scripting’s great for modders, especially modders without l33t Java skills. You give the scripting engine a small but useful subset of the API to your game and let the modders monkey around.

Cas :slight_smile:

Yeah, I can’t see me making anything proportionate in the future but it would be cool to learn how to do it imo.

You could also try out clojure as scripting language which ‘natively’ runs on the JVM :slight_smile:

Do you really need scripting? Is the price of dynamically typed / arbitrary container languages really going to buy you anything useful? Most likely if you need scripting, java would be just fine.

+1, and if you need live compilation of user scripts, check out Janino

Or, alternatively, I’ve recently repackaged javac and the Janino bindings for that if it’s of use to anyone - https://github.com/praxis-live - more heavyweight than the Janino compiler, but I need some extra functionality.

Also there are Java “ports” of scripting languages to allow them to run in the JVM. The ones I’ve used are Ruby (in the form of JRuby) and Lua (in the form of Kahlua). Lua is the one I recommend for scripting and Kahlua was also very helpful (when I used it I had to hack and slash with a lot of the lua backend which was almost simple in Kahlua).

I can’t see a good reason to use a Lua like language when we now have Nashorn. The latter is virtually insured to perform better and to be regularly updated. But then again I can’t think of very good reason to go prototypes either.