Sign in to follow this  
Kaptein

Scripting language

Recommended Posts

Hey guys, I've been looking at AngelScript because I need a scripting language. I've previously been using TCC always, because it compiles to native code and its kinda fun to compile to memory.. Now I look at AngelScript, but it feels kinda weird. Only reason I know about AngelScript is I remembered it from gamedev.net a long time ago! :)

 

I don't really need tight integration, just need a language that can capture storage into lambdas (which of course TCC never could as its a C compiler), but im getting tired of the temporary storage issue. I have no intention of writing abstractions for storing event data. I would like the scripting language to solve this issue, otherwise why use it over TCC? :) I have also been considering just compiling the script with a C++ compiler, but no. It sounds horrible. There are people who would like to work with me, and I think they can do simple things in a scripting language, like create dialogue.

Should I be using LUA instead? Any other recommendations?

Any list of scripting languages that support anonymous struct functors?

Thanks!

Edited by Josh Petrie

Share this post


Link to post
Share on other sites

LUA supports anonymous functions and closures so it should be capable of what you want, it's also fairly straightforward to embed in C++ so I think LUA should be your first choice.

As for other languages that can be used for scripts, there's Python and Ruby but I think those will be overkill unless you want to write most of the gameplay code as scripts. 

There's also Javascript and Lisp/Scheme that could be used but I wouldn't pick them unless you like writing code in those languages.

Share this post


Link to post
Share on other sites

Alright, so I went with LUA and MoonScript. Flexible enough for me. I like the simplicity of both, although the moonscript OO class syntax is kinda weird. At least it works. LUA seems to have OO capabilities in an unusual sense. And I don't have to choose. I can mix and mash moonscript and LUA as I please!

Share this post


Link to post
Share on other sites
Lua doesn't provide an OO class system out of the box, but does give you enough tools to implement classes yourself :o
It's at first very strange when coming from an OO language, but it's nice that you get to choose which flavour of OO you'd like to implement. Many games I've worked on have had extra features in their class system, such as Mixins. Lua is also stupidly flexible when it comes to how you bind your own non-Lua code to it; there's endless styles to choose from.

A side effect though is that Lua code from two different games will often have completely different architectures and styles, which hinders open source code sharing and library development.

Share this post


Link to post
Share on other sites
I do recommend Lua. Just be careful to not overuse it, like I did once. Use it for more high-level layer, instead of core layer. I once wrote a engine with many, many bindings for Lua (ENet, the entire OpenGL, package management with minizip, window management, etc). Everything could be accessed from Lua. For small games, it's nice, but it will hurt the performance in places where you need good performance (physics, for example). As, stated by Hodgman, be aware that Lua doesn't provide OO, but to be honest, if you need OO in the scripting layer, I feel you are probably falling in the same trap I did by pushing too much into the script-side. With all those observations made, I still recommend Lua over other script languages, because it's stupidly simple to embed, to make bindings, and is very fast and small compared with other script language APIs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this