• Advertisement
Sign in to follow this  

Unity IronPython vs Boo vs Lua.net

This topic is 3529 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
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
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By Yosef BenSadon
      Hi , I was considering this start up http://adshir.com/, for investment and i would like a little bit of feedback on what the developers community think about the technology.
      So far what they have is a demo that runs in real time on a Tablet at over 60FPS, it runs locally on the  integrated GPU of the i7 . They have a 20 000 triangles  dinosaur that looks impressive,  better than anything i saw on a mobile device, with reflections and shadows looking very close to what they would look in the real world. They achieved this thanks to a  new algorithm of a rendering technique called Path tracing/Ray tracing, that  is very demanding and so far it is done mostly for static images.
      From what i checked around there is no real option for real time ray tracing (60 FPS on consumer devices). There was imagination technologies that were supposed to release a chip that supports real time ray tracing, but i did not found they had a product in the market or even if the technology is finished as their last demo  i found was with a PC.  The other one is OTOY with their brigade engine that is still not released and if i understand well is more a cloud solution than in hardware solution .
      Would there  be a sizable  interest in the developers community in having such a product as a plug-in for existing game engines?  How important  is Ray tracing to the  future of high end real time graphics?
    • By bryandalo
      Good day,

      I just wanted to share our casual game that is available for android.

      Description: Fight your way from the ravenous plant monster for survival through flips. The rules are simple, drag and release your phone screen. Improve your skills and show it to your friends with the games quirky ranks. Select an array of characters using the orb you acquire throughout the game.

      Download: https://play.google.com/store/apps/details?id=com.HellmodeGames.FlipEscape&hl=en
       
      Trailer: 
       
    • By khawk
      Watch the latest from Unity.
       
    • By GytisDev
      Hello,
      without going into any details I am looking for any articles or blogs or advice about city building and RTS games in general. I tried to search for these on my own, but would like to see your input also. I want to make a very simple version of a game like Banished or Kingdoms and Castles,  where I would be able to place like two types of buildings, make farms and cut trees for resources while controlling a single worker. I have some problem understanding how these games works in the back-end: how various data can be stored about the map and objects, how grids works, implementing work system (like a little cube (human) walks to a tree and cuts it) and so on. I am also pretty confident in my programming capabilities for such a game. Sorry if I make any mistakes, English is not my native language.
      Thank you in advance.
  • Advertisement