Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

irbrian

Choosing a Scripting Language

This topic is 5211 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''ve been looking for a good scripting language to adopt for some projects I''m working on, and I''d appreciate some input. In particular, I''m looking for an easy-to-use language with a C-like syntax, but that is object oriented. I''d also like to use a language with a more streamlined, elegant feel.. garbage collection, no weird syntax, etc. I guess I''d almost like a JavaScript-esque language. GameMonkey looks pretty close to what I''m seeking, but it doesn''t appear to support OOP, and sounds as if its got a bit of maturing to do yet. So, any recommendations? **************************************** Brian Lacy ForeverDream Studios Comments? Questions? Curious? "I create. Therefore I am."

Share this post


Link to post
Share on other sites
Advertisement
id say ''go for Python'' but recently i may be a lil biased cuz i got crazy about that language it just rox.

just take a look @ what Bruce Eckel has 2 say about Python:
http://www.mindview.net/Etc/About/InformITRaw_html

Share this post


Link to post
Share on other sites
Aside from native support for OOP, Lua 5 is awesome.

I''ve also used SpiderMonkey, and was satisfied with the results for the most part, but I found that it handles exceptions poorly. Exceptions would handle fine before my engine started, but if the code was incorrect and tried to fire during the main application loop, things would hang. There''s probably some way to set the cooperative level of SpiderMonkey, but I haven''t bothered to look into it yet.

~Graham

----
while (your_engine >= my_engine)
my_engine++;

Share this post


Link to post
Share on other sites
According to my understanding, neither Python nor Lua has C-like syntax.

SpiderMonkey sounds promising.. still looking for tutorial and reference content though. I mean, I realize its JavaScript, but I'm not totally clear on how JavaScript would be used as a general purpose scripting language yet.

[edited by - irbrian on April 5, 2004 1:04:44 PM]

Share this post


Link to post
Share on other sites
As far as I can tell, SpiderMonkey seems to have the syntax and capabilities I need. But I cannot seem to find straightforward information on actually using it, although there are plenty of references on embedding it.

Are there any good, introductory-level tutorials out there for using it as an application scripting language -- especially for using it to develop game logic modules? Or can someone write one?

Share this post


Link to post
Share on other sites
You may find this useful:
http://users.skynet.be/saw/SpiderMonkey.htm

You''re right in that Python and Lua aren''t particularly C-like, but they''re popular for a reason. They may be easier to embed and work with and are problably better documented. How to create entire game logic modules is probably well beyond the scope of any tutorial, which is possibly why the more popular languages are the ones that are easier to embed in the first place.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
I''ll never understand why people esteem "C-like syntax" so highly. Is there really that much of a difference between

int bar()
{
    if(i == 3)
    {
        foo(i);
        return 2;
    }
    else
    {
        return 1;
    }
}

and

function bar()
    if i == 3 then
        foo(i)
        return 2
    else
        return 1
    end
end

?


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
quote:
Original post by Sneftel
I''ll never understand why people esteem "C-like syntax" so highly. Is there really that much of a difference between...
In the end, no, of course not.

I like C syntax because, among other things, I like knowing exactly where things begin and end. There are subtle benefits like the ability to wrap statements without using any special characters.

For me, C-based syntax is clear and concise, easy to read, easy to understand. Of course I realize that this is not the case for everyone. It is a personal preference, nothing more... but that''s a perfectly fine reason to desire it.

Share this post


Link to post
Share on other sites
quote:
Original post by Sneftel
I'll never understand why people esteem "C-like syntax" so highly. Is there really that much of a difference between
....



Not really - but I can imagine that writing a script in a similar language to the engine will save headaches (eg: syntax errors) and allow people to more easily conceptualise how the two work together.

[edited by - downgraded on April 5, 2004 11:17:56 PM]

Share this post


Link to post
Share on other sites

  • 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!