Here's an example of compiling and loading inline C code that works with SBCL and CMUCL: http://homepages.nyu.edu/~ys453/
SBCL: sb-alien package allows interfacing with C-code, loading shared object files, etc. See Foreign Function Interface. http://www.sbcl.org/manual/Foreign-Function-Interface.html
http://panela.blog-city.com/python_at_google_greg_stein__sdforum.htm
a few weeks ago and saw the part where they mentioned SWIG. This was quite an insight for me since I've been trying to figure out for a years the best way to write binary extensions for Perl, Lisp, etc. To see that Google uses it as a matter of course completely sealed it for me.
I have integrated it into my project over the last couple of weeks and I've got to say it is the bee's knees. It took some thrashing to get started and there are still some dark corners (e.g., typemap voodo) but I will never go back. My first project is a high performance sockets IPC module patterned after memcached/libevent and it works like a charm.
I highly recommend SWIG.
I was at a session in GDC where a guy from NaughtyDog talked about how they tuned memory access on PS2 for Jak and Dexter and that was cool; since they had full control over the compiler, they could place memory access instructions to the optimal places that would interfere least to other bus activities.
I've worked in the video game industry for the last two years, and I've been messing around with Direct3D/OpenGL for about 5. I believe wrapping these API's in an extremely high level language like Lisp might speed up creation of a video game by about an order of magnitude, especially if I expose only very high level graphical concepts to Lisp, instead of just exposing every API function.
Speed is crucial. I've layered Ruby onto my engine, but the problem was that if I wanted 60 frames per second, I could only do 16,000 Ruby if-statements per frame. That wouldn't work at all.
Even if the high level language I choose is only 4-10 times slower than C++, that would be fine. Ruby was about 100-200 times slower.
Investigating Lisp, I only require two things:
1) Somehow, I expose C functions to Lisp. These functions take standard types as arguments (float, int, double, char ...).
For example, I might expose, from C:
(Edit: argh, I can't write a star on News.YC. The following should read: "const char (star)str")
void print_to_game_console(const char str);
Then in lisp, I'd then be able to do (print_to_game_console "Odelay!")
Something along those lines.
2) Lisp only has access to what I expose. I won't get into the boring details, but I'm distributing the Lisp script files for anyone to edit and run on other's machines, so sandboxing Lisp somehow is also pretty crucial. As long as under no circumstances can Lisp access the file system, then everything else is fine.
Thanks everyone! Shawn