Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This video game won't be super fancy, but the idea is for it to have a moderate amount of functionality. Thoughts?


Fast would be nice.

Another edit:

This is what I want:

  • To be able to compile everything to .class files that can be packaged into a .jar and run as an application.
  • To be able to have working mutable types.
  • Have stack traces when there is some sort of error.

I was planning to use Kawa, but I was running into something weird with lists...

Yet another edit:

Any thoughts on JScheme?

Another edit:

Kawa works fine; I'm going to use it.

One last edit (should be the last one):

Now we're going to use Common Lisp (ABCL).

share|improve this question

closed as off-topic by MichaelT, GlenH7, gnat, Bart van Ingen Schenau, Robert Harvey Oct 26 '13 at 17:01

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – MichaelT, GlenH7, gnat, Bart van Ingen Schenau, Robert Harvey
If this question can be reworded to fit the rules in the help center, please edit the question.

It may be helpful for you to find a game-related framework with could help with your project, unless you are writing the whole thing yourself. You could start there. –  Jon Jan 13 '11 at 23:03
@Job: It isn't the only one though... ABCL, Kawa, and SISC all run on the JVM. –  compman Jan 13 '11 at 23:08
What do you want to have a Lisp for? –  user1249 Jan 21 '11 at 22:46
@user9521, awesomeness is not enough to make it useful. I think Ferraris are awesome, but they don't help much when wanting to build a tunnel between two islands. So what do you want to have it for? –  user1249 Jan 22 '11 at 10:41
Power = Work / Time. There are at least two kinds of power in programming. One is programmer power: how much functionality you can code in a given period of time. Another is run-time power: how much goal-achieving work a running program can accomplish in a given period of time. Lisp lets the programmer implement (comparatively) a lot of functionality in a given period of time. (At least that's what Paul Graham says.) Low-level assembly language lets you write a program that does a lot of what you want it to do in a given period of time. –  compman Jan 27 '11 at 20:45

4 Answers 4

up vote 7 down vote accepted

If you had left off the JVM requirement, I might have suggested ypsilon, since it was built by and for a videogame developer.

But for the JVM, Clojure would probably be the most sensible alternative, if only for the strength of its community right now. You may be able to find lots of people willing to help you out when researching performance problems.

Unfortunately, it may be hard to do an apples-to-apples comparison between Clojure and other JVM implementations of Lisp.

Assuming you are deploying to traditional PCs, rather than phones or small devices, and that your game project is not particularly resource-intensive, your biggest concern probably won't be absolute memory utilization, but hiccups caused by garbage collection pauses. So, in evaluating Lisps, you may want to run some tests to figure out whether there are differences between them in how often garbage collection is triggered, even if it is just caused by different strategies in newing objects. But you'll also have some of the same opportunities to tune garbage collection behavior yourself, by being careful with object creation, or sensible use of weak/soft references, or even just using command line tweaks JVM gc options when you start up the app.

You could also try building some benchmarks that are useful to you, and test whether different JVM Lisps exhibit different characteristics. A number of people have invested research into profiling Lisp; see, for example, http://openmap.bbn.com/~kanderso/performance/ and consider whether some of the approaches linked there would be relevant for your application.

In at least one set of tests, http://per.bothner.com/blog/2010/Kawa-in-shootout/ , Kawa performed somewhat better than Clojure on many tests. If that's a major consideration, you may want to at least explore whether similar benchmarks apply to your case or not.

It doesn't sound like you are overly concerned with this, but if a (nearly) complete common Lisp implementation were important to you, Armed Bear Common Lisp might be a better place to start than either of these. I like it just for the name, but that's probably not a good enough reason.

The biggest challenge of answering a question like "which is best for..." is the implicit, unstated "by some measure of best." For me, the strength of a community around a technology is often at least as important as the performance considerations, since I rarely develop in a complete vacuum.

share|improve this answer
Do you know how to deal with primitive Java types in ABCL? Also, do you know how to compile Lisp code to .class files with ABCL? –  compman Jan 22 '11 at 3:27
It looks like Java primitives are automatically boxed and unboxed between LispObject types and the Java primitives when you use ABCL to invoke Java methods. abcl-dev.blogspot.com/2009_09_01_archive.html explains a little bit about how to package a FASL into a JAR. You just use the normal (compile-file "hello.lisp") to create a fasl file (.abcl in this lisp). –  JasonTrue Jan 22 '11 at 23:04
I've got a java.lang.Frame visible and have drawn on it from ABCL's REPL, so ABCL should work for this project if its fast enough. I don't know how fast is fast enough exactly. Does anyone know how fast ABCL's compiled functions are (compared to whatever)? –  compman Jan 24 '11 at 18:43
Is there a way to create a Java class with ABCL (that extends another class)? (I also asked on Stackoverflow) –  compman Jan 24 '11 at 19:21
@me: You can create objects that implement Java interfaces from Lisp. trac.common-lisp.net/armedbear/wiki/JavaScriptingAPI –  compman Jan 24 '11 at 20:26

I think the hot lisp-like JVM language is clojure

There seems to be really good tool support. You'll also have access to the entire JVM stack, assuming that is appropriate for your game project.

share|improve this answer
I would be concerned about performance, see here: shootout.alioth.debian.org/u32/compare.php?lang=clojure. Admittedly, these are arbitrary benchmarks, but Clojure seems to use an alarming amount of memory and processor horsepower. I wonder if these characteristics make it unsuitable for game programming? –  Robert Harvey Jan 13 '11 at 23:21
@Robert: That's not too surprising. Lisp (in general) and the JVM are both notorious for hogging too many system resources. Mix the two, and the results are kinda predictable... –  Mason Wheeler Jan 21 '11 at 22:28
Yup Scala(kinda) or Clojure. Nothing else to say. –  zhenka Jan 21 '11 at 22:59
I don't think anyone's fully optimised the Clojure code yet for the shootouts - in my experience you can get pretty close to pure Java / Scala speed with Clojure providing you optimise things correctly (use primitives rather than wrapped objects, apply type hints where needed etc.). And yes, I have written a GUI game in Clojure - mikera.net/ironclad –  mikera Jun 10 '11 at 0:00

I've sucessfully used Clojure to write a simple game - http://mikera.net/ironclad/

My thoughts on Clojure as a game programming language:

  • It's easily fast enough overall, although you do need to learn a few optimization tricks (such as using static type hints to avoid reflection and using primitive artithmetic rather than the nice-but-slow BigInteger arithmetic)
  • You get the benefits of being able to use all the Java libraries for graphics, IO etc. Some of these have Clojure wrappers already but such wrappers are not really essential - you can just call the Java libraries directly if you like.
  • Clojure is stylistically more of a functional programming language than other Lisps - this can take a bit of getting used to for game programming although once you pick up the techniques it is very powerful
  • The Clojure concurrency features are great for games - managing network events, user input, parallel processing of AI etc. was all a breeze.
  • Macros are great for games! Not only do they help you with writing some of the thornier game logic, the fact that they run at compile-time can enable some neat performance optimisations.

Overall - very happy with Clojure for game programming, would have no qualms about using it again for another JVM game project - only exception would be a pretty intensive 3D game in which case it probably go for Java directly (maybe using Clojure as a scripting language)

share|improve this answer

As I understand you like functional languages but you don't want to deal with lack of good libraries. I assume you are an aspiring game developer.

In that case your only realistic option is to go with c++. C++ historically developed as a tool for making games and all of the libraries such as DirectX and many other tools will only work for c++.

The advantages of functional languages do not out-weight the benefits of C++ in the gaming arena, not by far. I know it sucks and I would also prefer to use functional languages but such is life. You would have to reinvent the wheel A LOT without c++ and you probably won't get very far on a serious project.

Take advantage of the mountain of tools developed with c++.

share|improve this answer
Not responsive. Plus, the JVM already has a number of games running on it, so the advice is dated. The specific performance and library needs would depend very much on the game requirements. –  JasonTrue Jan 21 '11 at 23:16
If you think it is dated, I challenge you to provide evidence because last I checked all the major games still run on C++ I am not denying there arent games written in other languages. I can make tetris in scheme too. –  zhenka Jan 21 '11 at 23:18
Not responsive==not answering the question. Which Lisp is best for a videogame on the JVM? Probably not C++, since it is neither a lisp nor something that's useful for the JVM. "Dated" was just an aside. Besides, there are a lot of "major" games written in Flash and Java, just not many that hardcore gamers care about. Farmville has more users than Call of Duty (for now). And mobile phones are a pretty good place to deploy Java-based games. Depending on your performance requirements, an OpenGl bridge to the JVM and some clever thinking in Clojure or another Lisp may get you pretty far. –  JasonTrue Jan 21 '11 at 23:37
You say I like functional languages... there is nothing inherently functional about Lisps. Nothing. Absolutely nothing. It may be a major style, and Clojure specifically may have really good support for it, but I repeat: nothing. –  compman Jan 22 '11 at 3:24
-1: 1) Lisp is not exactly functional - it is more properly called a "metaprogramming" language. One can easily program in it using imperative, functional or OOP styles - and I suspect that if another not-yet-invented school comes out, it will be supported by Lisp. 2) What you've said is basically "I don't know, but C++ KICKS ASS!!", with much more words. 3) You whine too much - you should at least have the grace to accept well-deserved criticism. –  rsenna Jan 24 '11 at 21:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.