Choosing a Scripting Language

Started by
37 comments, last by irbrian 20 years ago
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."
---------------------------Brian Lacy"I create. Therefore I am."
Advertisement
Considered using JavaScript itself?

SpiderMonkey (JavaScript-C) Engine

It''s under the Mozilla Public License, which you can peruse here.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
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
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++;
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]
---------------------------Brian Lacy"I create. Therefore I am."
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?
---------------------------Brian Lacy"I create. Therefore I am."
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]
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
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.
---------------------------Brian Lacy"I create. Therefore I am."
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]

This topic is closed to new replies.

Advertisement