2 Replies - 640 Views - Last Post: 16 August 2012 - 12:53 PM

#1 salindor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 46
  • View blog
  • Posts: 301
  • Joined: 10-November 06

emdeddable languages

Posted 15 August 2012 - 06:58 PM

So I am writting a game as side project/hobby (in C/C++), and I would like to embed a scripting language in it (for helping build the world and such). I haven't embedded a scripting language into a program before.

So I decided to use this post as both a place to collect my thoughts and get other peoples opinion since I know there are people who write games on the forum. I posted it here because I am far more concerned with looking at as the software engineer thought processes than that of the game development thoughts (though I guess I really want both but I have to pick a forum).


-------------------
So to start the background of the team (in this case 2 should be considered):
- for me the languages I am comfrontable programming in is: C, C++, C#, Java, Actionscript (though my favorite is C++ and C#). I tend to be a backend algorthim loving programmer.
- my brother: Javascript, Actionscript, and C# (though he is new to C# and when he switched I heard for a month how great it was compared to Actionscript). He is a front-end GUI web page developer.

Desired architecture would be:
C++ (calls) <language> (calls) C++

I can cheat by having the call back be specific hooks (infact I am almost thinking that is preferable)

There are only three canidants I am aware of to consider:
Lua
The original language I was considering. I have heard that because arrays and maps are the same thing it can be confusing to people who are heavy c++ programmers. But I have heard it is pretty lightweight and fast. It also seems straight forward to embedding it
Python
I wasn't originally thinking of this language until a friend suggested it. I have heard that is a rather buggy language. It seems like it has the advantage that I could double by learning a server scripting language since I currently don't know any.
Ruby
This was an unexpected suggestion. I have heard of it in the past as a server side scripting language? One brief site I found suggesting embedding it to be a pain. The examples I saw looked clean but they looked a little like the examples I saw of Python.


So thoughts? Any strong suggestions? Anyone do something like this they can share their experiences?

Thank you in advance,
Salindor

Is This A Good Question/Topic? 1
  • +

Replies To: emdeddable languages

#2 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1372
  • View blog
  • Posts: 3,469
  • Joined: 28-November 09

Re: emdeddable languages

Posted 15 August 2012 - 07:08 PM

Both Ruby and Python can be used as full development languages.

Personally I love Ruby. One of the major features it tends to emphasize are Domain Specific Languages. If you want to use it, I would go its way purely.

Metaprogramming, Active Record (ORM), and a more pure OO style. Ruby is a strong language if you learn how to use it.

Rails for Web is everything to me that PHP failed to live up to. With its backing in Ruby it feels a lot more solid and powerful to use.

Metaprogramming is still the point which drove me home on it. Look into Metaprogramming with Ruby (Pragmatic Programmer) to get a good idea of some of the more interesting and powerful uses.

Your mileage may vary, I'm a rather die hard Rubyist.
Was This Post Helpful? 1
  • +
  • -

#3 salindor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 46
  • View blog
  • Posts: 301
  • Joined: 10-November 06

Re: emdeddable languages

Posted 16 August 2012 - 12:53 PM

Thank you for the response. I have been meaning to look into ruby and I guess I just wanted to hear someone who has used it to say yes it is an awesome langauge.

As I was learning the language I realized a new issue someone looking to embed a scripting langauge should be concerned with: sandboxing.

Right now the developers are people I trust explicitly; part of the idea in adding a scripting language is so other people (less skilled/trusted) can contribute in a safe manner. However ruby has the ` ` syntax for executing system values. Then once I thought about that I was thinking oh crap, I should also disallow network code and file system access.

Salindor
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1