Advertisement

Lisp and Scheme, do you use them?

Started by September 21, 2004 10:29 PM
27 comments, last by Woodsman 20 years, 2 months ago
Quote: Original post by Spoonster
Well, there's a big difference between the university definition of AI, and what game developers mean when they discuss AI. For the former, I believe Scheme (or Lisp) is very useful, but it might be a bit messy for use in game development. (The problems you want to solve are simpler, and you want more performance, and finally, getting different languages to talk to each others is always tricky)

I'm aware of that.

I just find that some classmates of mine take professors' words as gospel, who, in turn, took their professors' words as gospel.

Not using a language because it's not popular or because a professor looks down upon it without informing yourself from other sources seems a folly to me.

This is offtrack.
If a plant cannot live according to its nature, it dies; so a man.
Quote: Original post by Woodsman
Quote: Original post by digitec devil
my professor said that current real A.I. projects are done in C++

Did he happen to mention why?


No he didn't, I didn't think(or perhaps care) to ask. But generally speaking he's in a group of professors I tend to trust when they talk about the real world.
Advertisement
Hmm, would you mind if you told me his name so I could e-mail and ask him? I see you're in Houston, does that mean you go to Rice University? I go to UT Austin ^^

Hero of Allacrost - A free, open-source 2D RPG in development.
Latest release June, 2015 - GameDev annoucement

Quote: Original post by Krysole
If you are writing *nix software then there are many well developed solutions available for you to embed in your application allowing you to write your ai code in Lisp. However, for other platforms all of the solutions I'm aware of are commercial and may be dificult to obtain if you do not own an American credit card!

I am not sure about common lisp, but for scheme there exist many open source implementations that compile fine on windows. For embedding in an application the big fat monster that is common lisp is probably a little too much anyway, a more minimal language like scheme is more suitable.

And I think whether using lisp is a good idea depends a lot on the problem you are trying to solve. 'AI' is such a broad field that you can not make blanket statements about it. If you want super-fast pathfinding you'd best use a low level language, but if you have a complex problem with lots of rules where performance is not the problem, the elegance and expressive power of lisp-like languages is going to make your life a lot easier.
It's been a while since I've posted at these forums, but in that time, I have learned Lisp. I love it, and would not go back to any other language. In fact, all of the other languages look really weird now. Lisp has a GC, and so it makes stuff really easy. For instance in C++:

int x;
int y;
class do_something_with_something {
private:
int q;
int z;
bool function();
public:
q(); // q and z work on int x and int y
z();
}

in Lisp:

(defun foo (args &rest more_args)
(cond ((null args) nil)
(t (do_something_with_args))))

I don't have to declare the varible lambda list args here as I had to declare it in C++. These may not be that clear, but hopefully you get the general idea. I check back here later on, right now I have to run.
neo88
My Kung Fu is stronger.May the Source be with you.neo88
It's been a while since I've posted at these forums, but in that time, I have learned Lisp. I love it, and would not go back to any other language. In fact, all of the other languages look really weird now. Lisp has a GC, and so it makes stuff really easy. For instance in C++:

int x;
int y;
class do_something_with_something {
private:
int q;
int z;
bool function();
public:
q(); // q and z work on int x and int y
z();
}

in Lisp:

(defun foo (args &rest more_args)
(cond ((null args) nil)
(t (do_something_with_args))))

I don't have to declare the varible lambda list args here as I had to declare it in C++. These may not be that clear, but hopefully you get the general idea. I check back here later on, right now I have to run.
neo88
My Kung Fu is stronger.May the Source be with you.neo88
Advertisement
weird. Sorry bout that. Not used to the new gd.net :)
neo88
My Kung Fu is stronger.May the Source be with you.neo88
I don't use Lisp or Scheme, but I did use Corman Common Lisp for a while and I definitely did feel the whole "Lisp is king" thing. The only reason I didn't stick with it is that I started working and I have to use C++ at work, plus I wasn't and still am not programming much at all really. My biggest problem with Lisp is that it is just SO huge it will take a while to learn well enough that I don't have to constantly look stuff up, plus there are times when I feel regular c++ style pointers would make some things SO much easier. The whole 'its a pointer unless its a certain kind on number' thing makes some things really painful.

I really think that if there is every a revision to the Common Lisp specs, Lisp would have a real chance of coming back and being king for real. The problem is that people are happy making their own homebrew version of lisp instead of making a standard on the level of .Net or Java (the Lisp standard is just soo old...).

RE OP: Lisp/Scheme/other language is not an "AI Language", they are all general purpose languages and they can all be used for any purpose including AI.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Quote: Original post by Extrarius
I really think that if there is every a revision to the Common Lisp specs, Lisp would have a real chance of coming back and being king for real. The problem is that people are happy making their own homebrew version of lisp instead of making a standard on the level of .Net or Java (the Lisp standard is just soo old...).

Agreed. After reviewing a number of embeddable lisps and schemes, I eventually ended up writing the functionality I needed for a project. I'm keeping the libraries I've tested around for future consideration, but you're very right.

Also, I just realized that you sent me some links on (lisp related) GC several months ago and never thanked you, so Thanks!
If a plant cannot live according to its nature, it dies; so a man.
Quote: Original post by Extrarius
I really think that if there is every a revision to the Common Lisp specs, Lisp would have a real chance of coming back and being king for real.


From what I've heard, the Lisp specs are just fine. There's a lot of stuff missing from them (threads, etc.), but it wouldn't be possible to add it to the specs because the important Lisp vendors already implement that stuff in various ways and they cannot afford to change their products (and in doing so, break the code of their customers). Common Lisp is king now because and to the extent that it is used and usable for serious projects. It already has a level of maturity where change is hard to do (as opposed to, say, Java).

The question is not whether Lisp will be the next most frequently used language on the gamedev forums. The question is not even if it could be used to create existing games. The real question is what kind of game would most profit from Lisp's strengths? Chances are it could be a pretty unique game, with everybody "serious" in the "real world" doing FPSs in C++ and all.

This topic is closed to new replies.

Advertisement