Sign in to follow this  

Unity IronPython vs Boo vs Lua.net

This topic is 3458 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
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
Quote:
Original post by Ahnfelt
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.


I thought it came from the expression "If it walks like a duck and quacks like a duck, then it is a duck."

Share this post


Link to post
Share on other sites
I'm using IronPython,
Its worked really well so far, a nice feature is that it uses reflection to registrar classes so you only need like 12 lines of code to set it up, I even made a in game console where I can type in python code to invoke almost any method in the game at any time.

Share this post


Link to post
Share on other sites
Quote:
Original post by smr
Quote:
Original post by Ahnfelt
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.


I thought it came from the expression "If it walks like a duck and quacks like a duck, then it is a duck."


It does. That thing up there was a mnemonic I just discovered ;-) I probably should have made that clear. My definition is correct though (as far as I can understand).

[Edited by - Ahnfelt on June 23, 2008 4:35:05 PM]

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.

Yeah I'd recommend Boo too if you want to save on typing since it's the most wrist friendly language here;)
You might want to stick with IronPython though, especially if you want to use Visual Studio IDE anyways.

Share this post


Link to post
Share on other sites
Quote:
Original post by daviangel
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.

Yeah I'd recommend Boo too if you want to save on typing since it's the most wrist friendly language here;)
You might want to stick with IronPython though, especially if you want to use Visual Studio IDE anyways.


I used Boo and I don't think it's any more 'wrist friendly' than C#. Sure, you don't always have to type braces or semicolons, but how much typing does that actually save you? Boo's type inference isn't any better than C#'s. They both save you from some redundancy "MyRidiculouslyLongClassName o = new MyRidiculouslyLongClassName()". I think intellisense makes writing C# code within Visual Studio about as wrist friendly as one could hope for.

Share this post


Link to post
Share on other sites
It sort of surprises me that there are no real supporters for Lua, and that there is no better support for Lua in C#, since it's so "big" in games (or so they say).

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


I would use C# in a heartbeat if I found a (feasible) way to do edit and continue. For now I haven't found it. That's the main reason why I'm looking into other languages right now.
What saddens me though is that neither the IronPython nor Boo Wikis mention anything about edit-and-continue support. But since you write IronPython in the VS2005 IDE it's possible it does support it, but I'll have to spike that myself.

Share this post


Link to post
Share on other sites

This topic is 3458 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.

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