Panda3D with Scheme or Lua anyone?

Python is a nice language, but unfortunately not so strong in higher-order programming. Has anyone linked Panda3D with, say, Lua, or (preferably) Scheme?

I have only occasional access to the Internet, so don’t be amazed if I am slow in replying.

We once had an interface with Squeak (a variant of Smalltalk), but we haven’t maintained it and I don’t know if we even have the code that generated the wrappers anymore.

However, the design of interrogate is such that it should be able to produce wrappers for any other language without too much trouble. You’ll have to be responsible for writing and maintaining the interface layer to produce the wrappers, though.

Alternatively, you can look into some third-party tools that interface C++ libraries to higher-order languages, like SWIG. If you search the forums, there are references to some efforts a Panda user had put into making SWIG work, a year or two ago.


While David’s suggestions are helpful, I question whether it’s really worth the effort to try to get Panda working with Scheme or Lua solely because of higher order function support. While Python isn’t a pure functional language, it’s support for function programming is pretty decent. I have a hard time believing that trying to get an entire game engine working with an unsupported language is less work that dealing with whatever minor deficiencies you perceive in Python.

Would you mind describing the kind of higher order functions you want to use? I’d bet that someone could figure out a way to do what you need in Python.

Higher order function functions and closures work great in python … the only difference is that you have to name them.

Well, I said I might be slow in replying… :slight_smile:

I know how to work around limitations in programming languages (hey, I have even written algorithms for Turing machines, for a course in compulability!).

I just like the ease with which e.g. learning can be implemented by wrapping functions around one another. Let’s say a character has acquired behaviours X and Y, and now learns to choose between them based on some test Z: (lambda () (if (Z) X Y)) is the new behaviour that does the trick. Doing stuff like that a lot of times makes for quite sophisticated behaviour, and the compiler takes care of keeping it efficient.

Of course I can define some data structure to walk through, and that is what I do at the moment, but it means that I need to optimise by hand (well, by explicit code).

(Of course, this is just one example of many where higher-order programming comes in handy.)

Thanks for replying, and till next year… :smiley: