Jump to content
  • Advertisement
Sign in to follow this  
Wavesonics

AngleScript better than LUA?

This topic is 3453 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been evaluating AngleScript, LUA, and GameMonkey because I am looking to integrate some scripting into my new game. LUA seems to be the most popular, but I don't love it's syntax. GameMoney is interesting but looks unmaintained. AngleScript how ever looks awesome. Run-Time compile of scripts to byte code, GC of course, OO style, and better syntax. But what is everyone's opinion, which is better? What do you use?

Share this post


Link to post
Share on other sites
Advertisement
Well, I was also into lua, because it's used by so many people, however the syntax is awful. Why should I want to care about lua's stack and call dozens of functions, if that can be done with a single clean call to the AS script engine?
I clearly prefer angelscript, it's alot of easier to use (using classes in lua is a real pain, whereas in AS it's so easy) in every way.

Share this post


Link to post
Share on other sites
Well, after a quick look at angelscript, I find several missing features compared to lua:

- functions as first-class objects and closures. It makes a lot of things nice and easy with lua. You can create an event handler in a snap for instance just by defining a function inline where you need it. They can reference variables from the enclosing scope even if they exist longer than that scope.
- exceptions (lua have this in the form of lua_error and lua_pcall).

Additionally, lua allows to mix garbage collection and c++ reference counting much more easily. Create a userdata object (which will be automatically be garbage collected), embed a shared_ptr into it and you basically don't need to care about ownership ever from the lua side. Implementing a custom garbage collected object in angel script seems much more painful, and I'm not comfortable with angel script exposing many options regarding object ownership directly into the language either, it seems that having to care about such things kind of defeats some of the purpose of using a scripting language.

Of course, if you do it manually binding functions and classes to lua is a pain. If you're going to do it manually, then yeah, angel script is easier. But doing things manually in angel script still looks a lot more work than using an automated binding generator of some sort. And if you use a binding generator, then you don't care about the complexity of the script engine api.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!