Alternative languages, these days.

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Alternative languages, these days.

Post by ahmedali »

I was looking for not so well known languages and atleast having the possiblity to access essential libraries for 3d game development. From a game programmer's POV some of these languages may seem practical other may help a programmer to improve his designing & problem solving skills.

Embeddable scripting Language:
Besides lua, python, squirrel, pawn/small, angelscript & other well knowns...

io scripting language: (based on Smalltalk, Self, Lua, Lisp, Act1, NewtonScript)
http://en.wikipedia.org/wiki/Io_programming_language
To me it seems a very interesting alternative to Lua. Besides dissimilar syntax, according to authors, it is heavily influended by lua. The C/C++ binding api is much easier than Lua. Plus many more features.

Cool languages: (not just cool names)

Scala: http://en.wikipedia.org/wiki/Scala_programming_language
Very apealing language because syntax looks like Python and compiles for both Java & .Net platforms. So you already have access to a broad range of Java & .Net libraries.
O'Caml: http://en.wikipedia.org/wiki/Objective_Caml
I guess one of the best functional language plus access to tons external libraries.
Oz: http://en.wikipedia.org/wiki/Oz_programming_language (alas! afaik no opengl)
Erlang: http://en.wikipedia.org/wiki/Erlang_pro ... g_language (used in Wings3d modeler)

Aaah! Lisp:
Lisp like scripting languages have been used in Jax & Daxter and AgeOfEmpires. And some other games.

I looked at various lisp implementations and dialects. They all have problems having lack of libraries which are essential for gamedev (correct me if...). Few have OpenGl access.

Here are ones I found having some practical value for game developers. Lisp implementations for .Net have high apealing because not only you have access to .net libraries but syntax and contructs are more imperative programming friendly.
-Lisp for .Net: http://www.lsharp.org/
-Another Lisp for .Net: http://dotlisp.sourceforge.net/dotlisp.htm

Lush (must checkout): http://lush.sourceforge.net/
A lisp based language, uses C compiler, supports SDL & OpenGl with example programs.
NewLisp: http://www.newlisp.org
A very simple lisp, simpler than scheme. has opengl module.

Embedable Scheme:
http://en.wikipedia.org/wiki/Guile_programming_language
http://sam.zoy.org/elk/
http://www.plt-scheme.org/software/mzscheme/
http://code.google.com/p/muvee-symbolic-expressions/

Embedable Lisp:
http://ecls.sourceforge.net/

Embedable Lisp in Lua:
http://vslisp.sourceforge.net/
http://blog.davber.com/2006/09/07/embed ... p-via-lua/

google for for more scheme/lisp.
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
x 3
Contact:

Post by Praetor »

Scheme/LISP is certainly very interesting. I like it, to a point. To be honest, it is very difficult for me to pick it up because I'm so used to OO and imperative. But that's a personal problem (though it could be a common personal problem).

Interesting that Io claims to be easier to embed than lua. Because lua is really really easy... I'll definitely look into it out of curiosity though. Thanks for the link.
jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp »

When it comes to interesting languages do never forget to mention Haskell (it does have OpenGL access) :D
Enough is never enough.
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

Yes Lisp/Scheme can alienate regular imperative programmers. But at first glance at .Net lisp implementations, they have made constructs & other changes friendlier for imperative programmers and to take advantage of .net . So it is possible to use .lisp as an imperative language too at reasonable extent. But personally Im a imperative programmer too; I use lisp for experimental stuff only.

Io has not gained as much popularity as lua, though it has many developers.

A tutorial showing binding io to c++. There are no automated binding project.
http://en.wikibooks.org/wiki/Programmin ... to_C%2B%2B
turkeypotpie
Halfling
Posts: 53
Joined: Thu Apr 28, 2005 12:09 am
x 1

Post by turkeypotpie »

When it comes to interesting languages do never forget to mention Haskell (it does have OpenGL access)
I love their quicksort example:

Code: Select all

qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)
I'm not sure if this is a good thing or a bad thing!
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

I was looking for not so well known languages and atleast having the possiblity to access essential libraries for 3d game development
D can link with C libs. It's been linked with SDL to make OpenGL games.
Take a look at http://www.asahi-net.or.jp/~cs8k-cyu/index_e.html for some awesome games done with D. All have source code available. My favourites are Gunroar and Tumiki Fighters.
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36
Contact:

Post by Nauk »

Thanks for the links, Torus-Trooper rocks to steam off :)
Lacero
Halfling
Posts: 72
Joined: Tue Feb 13, 2007 1:57 am

Post by Lacero »

Kojack wrote:
I was looking for not so well known languages and atleast having the possiblity to access essential libraries for 3d game development
D can link with C libs. It's been linked with SDL to make OpenGL games.
Take a look at http://www.asahi-net.or.jp/~cs8k-cyu/index_e.html for some awesome games done with D. All have source code available. My favourites are Gunroar and Tumiki Fighters.
It doesn't seem like theres any way to link with C++, is this right? It looks like I'd have to write lots (and lots!) of pure C interface functions for the dlls and then implement the class hierarchy in D somehow to use ogre. I'm interested in using D, at least a bit, and I'm trying to make sure I understand how much work it would be.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

Yep, c++ is out. D can link with C libraries only. The same applies to all languages I know, I haven't heard of any language able to use c++ libs directly.

Also, even if you have a C lib, you still need to convert the header file into a D binary module. There's tools to do that (iirc), but you might need to hand edit them if the header uses the preprocessor in tricky ways (D has no preprocessor, but it's compile time and language features (like static if, templates, etc) make up for it).

There was a project called swig4d, which used swig to attach C++ and D, but it was abandoned a few years ago. No idea if anything else has come along since (the thing stopping me using D is the thought of wrapping libs. It's easier to just stick with C++).
Lacero
Halfling
Posts: 72
Joined: Tue Feb 13, 2007 1:57 am

Post by Lacero »

Kojack wrote:(the thing stopping me using D is the thought of wrapping libs. It's easier to just stick with C++).
Yeah it sounds like it, the manual work to convert a .h file to a .d file looks possible, but writing a C interface to ogre would be a nightmare and would probably end up looking a lot like opengl anyway.

ah well, I'll keep it in mind in case I ever work on something where it would be usable.
Mecha
Gnoblar
Posts: 9
Joined: Sun Feb 22, 2004 10:20 pm
Location: Greater Pacific Northwest
Contact:

Post by Mecha »

Thunder and Lightning is probably the best poster-child for Io usage within a game. The TNL author has also recently submitted some patches for Io based on his experiences.
Post Reply