IronPython vs Boo vs Lua.net

Started by
14 comments, last by Structural 15 years, 10 months ago
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]
STOP THE PLANET!! I WANT TO GET OFF!!
Advertisement
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)
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:
STOP THE PLANET!! I WANT TO GET OFF!!
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.
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).
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.
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();// lambdasvar x = DoSomething(100, (y) => y + 1);// anonymous structsvar x = new { First = 100, Second = 200 };// closuresvoid 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;}
Sure. But maybe the OP doesn't want to use C# :-P.
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.
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.

This topic is closed to new replies.

Advertisement