Jump to content
  • Advertisement
Sign in to follow this  
Structural

Unity IronPython vs Boo vs Lua.net

This topic is 3709 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 am aware that these "vs" threads are often frowned upon, but I'm just eager to get an answer to the pros and cons of these scripting languages and their integration in C#/.NET. Google does not seem to return any pages that compare these languages. I'm still looking for a scripting language for my hobby project after my attempts to get EditAndContinue going for C# failed miserably. (Note: The last link to the MGDB thing seems to work, but I have the feeling it's too much effort to refactor all of it so it fits in my codebase, only to probably run into yet another problem) I have had Lua in my head for some time now because it's well known. But I'm beginning to have doubts because Lua is not specifically aimed at .NET. So who knows what problem may arise there. That's where IronPython comes in, aimed at .NET, a well known language, though I don't know how popular the IronPython platform is. Lastly I read about Boo, also Python for .NET with some extra language features like static typing. I'd like to hear your experiences with these languages, how well they integrate in C#/.NET. How stable are the interpreters? Is it easy to debug? Does it have edit and continue? How easy is it to make calls TO the "engine"? How easy is it to make callbacks to script? Have you encountered (m)any pitfalls? Or perhaps you are using other scripting languages? I have just about no experience with any of these languages: wrote 20 lines of Python in my life, and editted about as many Lua lines of code to fix some errors. So from an experience point of view it does not matter which language it's going to be, I'll have to learn it from scratch anyway. Thanks in advance. [Edited by - Structural on June 23, 2008 7:43:16 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by phantom
It's "Lua" not LUA.
Saying LUA is like saying PYTHON.

(yes, I'm on a one man crusade to stop the stupidity of that)


EDITTED FOR GREAT JUSTICE.

:rolleyes:

Share this post


Link to post
Share on other sites
Good [razz]

Anyway, Lua's problem is that it is a C library, which isn't a problem when calling but would require some sort of wrapping to get Lua to call your C# code as it would need a C layer in between of some sort.

There have been a couple of Lua.Net style projects, with LuaCLR even compiling Lua code to CLR code, however they are all somewhat incomplete. Infact, this is pretty much what is stopping me from jumping to C# myself right now.

Share this post


Link to post
Share on other sites
Python and Lua are both 10+ years old so neither of them are designed with .net in mind. The python effort seems to be the better at the moment as phantom points out Lua support on .NET is a little fragmented and incomplete (not to say python is 100% complete but they do have a 1.0+). I would go with iron python since it seems to be well supported and works reasonably well(can't use CPython extensions in some cases, since they are written in C) Boo maybe a good language, I don't know never tried it before (and can't since I have a mac), but I think you will find that to be the case with most programmers out there(not the can't but the haven't).

Share this post


Link to post
Share on other sites
I'm a big fan of Boo (and stonemetal, I'm on a Mac and it works just fine ;)). I've never really used Python, but I know the syntax between the two are similar. What I love most about Boo is it's type Type inference. It's basically static typing without having to actually type the type. http://boo.codehaus.org/Type+Inference

I recommend Boo.

Share this post


Link to post
Share on other sites
Quote:
Original post by bronxbomber92
I'm a big fan of Boo (and stonemetal, I'm on a Mac and it works just fine ;)). I've never really used Python, but I know the syntax between the two are similar. What I love most about Boo is it's type Type inference. It's basically static typing without having to actually type the type. http://boo.codehaus.org/Type+Inference

I recommend Boo.


I recommend C#. It supports most of the "dynamic" language features that Boo does (duck typing?), but is more mature.


// type inference
var x = new MyClass();

// lambdas
var x = DoSomething(100, (y) => y + 1);

// anonymous structs
var x = new { First = 100, Second = 200 };

// closures
void func()
{
var callback = new SomeClassWithACallbackDelegate();
var x = 100;

// instance x is maintained on the 'heap' and will stick
// around as long as callback.callbackDelegate does.
// I'm also using a lambda
callback.callbackDelegate = (y) => y + x;
}





Share this post


Link to post
Share on other sites
Quote:
Original post by bronxbomber92
I'm a big fan of Boo (and stonemetal, I'm on a Mac and it works just fine ;)). I've never really used Python, but I know the syntax between the two are similar. What I love most about Boo is it's type Type inference. It's basically static typing without having to actually type the type. http://boo.codehaus.org/Type+Inference

I recommend Boo.


I guess I will have to give mono another shot. The last time I tried it, it crashed immediately trying to compile a C# hello world so I filed it under the not quite done yet category and moved on.

Share this post


Link to post
Share on other sites
Boo lacks generics. But I'm sure it's great if you like to sprinkle your code with dynamic casts (now you have to explicitly type your values too?).

Boo calls all it's dynamic typing "duck typing". C# does not support this, but the unrelated type inference is supported to some degree (for local variables), which smr shows in his example.

Duck typing is dynamic, structural typing. It simply means that the only check you make is a runtime check that a method exists when invoking it. Most dynamically typed object oriented languages have this.

I somewhat agree with smr. C# has the following benefits to you:
* it integrates well with your host language. In fact, it IS your host language!
* you like the language and know it well (why else are you using it).
* lots of people know the C-style syntax and the Java-like type system.
* it has a huge standard library.
* it will be supported long after your game has been reduced to abandonware.

EDIT: I just reread your post and found out you already tried C#. Then I can't really recommend anything.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!