Skip to main content
GameDev.net gamedev.net
🔒 Locked

Strongly-typed scripting language ?

Started by RedDrake Aug 1, 2007 at 3:44 AM 5 replies 7.6k views
Original Post
RedDrake
RedDrake
Can you recomend any usable strongly-typed language that folows c/c++ coding style. I tried AngelScript before, buth it was veary unstabile, and even harder to debug ... That was a year ago tough, so it might have changed. C# is realy not an option since the library needs to be portable. Basicaly Java is the only thing that comes to mind, but i don't know is java suitable for game scripting ? The JIT is a big +, but i don't know you have to have JavaVM installed on end user machine (for the interpreter emmebed in to application) or are there some DLL's to distribute along your app. Any other alternatives ? [Edited by - RedDrake on August 1, 2007 5:39:38 AM]
LorenzoGatti
LorenzoGatti
Do you mean you want an explicitly typed language? Because C and C++, with pointers, reinterpret_cast<>, variable memory alignment etc. rely on user good will for strong typing.
I don't see compelling reasons to declare types in a scripting language: it is a cognitive and practical chore for the script programmer, it is verbose and unnecessarily error-prone, and space and time efficiency due to less indirect execution shouldn't be a priority.
You can try actual strongly typed languages; Lua, Python and Ruby are rather close to C++ in style, but have been designed to be safer, simpler and more abstract.
Omae Wa Mou Shindeiru
Hanno
Hanno
As Lorenzo already pointed out most scripting languages are strongly typed, but you sound more as if you want a statically typed language.
I've never tried it myself (so I can't say if it's good), but it sounds as Pike might be the right language for you:
http://en.wikipedia.org/wiki/Pike_(programming_language)
http://pike.ida.liu.se/
Zahlman
Zahlman
Quote:
Original post by RedDrake
Can you recomend any usable strongly-typed language


Python?

Or did you mean statically typed?

(And why would you want that in a scripting language?)

Quote:
that folows c/c++ coding style.


Why on Earth would you want THAT in a scripting language?

Quote:
C# is realy not an option since the library needs to be portable.


Not heard of Mono?

Quote:
Basicaly Java is the only thing that comes to mind, but i don't know is java suitable for game scripting ? The JIT is a big +, but i don't know you have to have JavaVM installed on end user machine (for the interpreter emmebed in to application) or are there some DLL's to distribute along your app.


The idea with C# scripting, I think, is to have the base code also in C# and use reflection. That approach should work in Java, too, but strangely I've never heard of anyone doing it.

From what I know of it, you probably don't want to use Java to script a C or C++ base app. I'm told JNI calls are ridiculous to work with (and can be horrendously slow).
umbrae
umbrae
To post an opposing view so it's balanced, I like statically typed scripting languages. I believe that they remove a possible cause of error and allow an IDE to provide method completion. This is useful for learning a game API as the actions you can perform on an object can be shown in an auto-complete list.

I know there are plenty of good reasons to have a dynamically typed language, and someone is welcome to post them here.

The statically typed vs dynamically typed argument has been going on for a long time now, the only difference here is in the application, applying it to scripting languages. This gives dynamically typed langauges an advantage, but all the same arguments hold.

I don't think a statically typed vs dynamically typed languages debate is needed or wanted here, only the differences the scripting language avenue brings.
Ahnfelt
Ahnfelt
Like you I prefer programming in statically typed languages. But would a beginner rather use a dynamically or a statically typed language? I don't know, but you should take your audience into account.

In any case, haXe could be what you're looking for. It's statically typed, looks a lot like Java, and it runs on a rather small virtual machine called Neko. It can also compile to &#106avascript and Flash.
Zahlman
Zahlman
Quote:
Original post by Umbrae
To post an opposing view so it's balanced, I like statically typed scripting languages. I believe that they remove a possible cause of error and allow an IDE to provide method completion. This is useful for learning a game API as the actions you can perform on an object can be shown in an auto-complete list.

I know there are plenty of good reasons to have a dynamically typed language, and someone is welcome to post them here.


The argument, really, is that a dynamically typed language's advantages are especially useful in the context of scripting, while its disadvantages matter less there. In the core app, go ahead and use a statically typed language.

See also.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.