
Lisp in Jak and Daxter - tosh
http://wiki.c2.com/?LispInJakAndDaxter
======
dmbaggett
This comes up on HN periodically. Here are few points to keep in mind:

\- In 1994, when Andy started on GOOL, the tools around C/C++ were far more
limited. Basically all we had was GCC; there wasn't even a decent debugger in
the beginning if I recall correctly. So it was less crazy to make a whole DSL
for game control code then than it may seem now.

\- There was no GC; the PS1 only had 2MB of RAM so we had to be incredibly
careful and precise with memory management. It was also slow (33Mhz) so GC
pauses were obviously not going to be OK.

\- At least in Crash Bandicoot (I didn't work on Jak), lisp was not used for
the rendering engine, the collision detection, or the camera control code --
that was all written in C (or MIPS assembly). Lisp was used for character
control logic and various non performance intensive tasks, like the load/save
interface.

\- It really wasn't that hard to "make a whole new language" in our case
because Andy used Allegro as the basis for the compiler -- and of course with
lisp, code is data. :)

It was a labor saving device and a boon to rapid prototyping of character
behaviors to have a simple very high-level language for this. This advantage
was ultimately offset over time as the platforms got faster and gained more
RAM. But at the time, there was no Python, Lua, etc. -- and even if there
were, they'd be too RAM-intensive to use. (Maybe embedded variants of these
languages would have worked, though.)

~~~
girvo
This is why I love HN! Thank you for building amazing games that made my
childhood better

------
lunchladydoris
Dan Liebgold from Naughty Dog did a talk on using Racket during development
for the PlayStation 3 at Racketcon a few years ago [0].

[0]:
[https://www.youtube.com/watch?v=oSmqbnhHp1c](https://www.youtube.com/watch?v=oSmqbnhHp1c)

------
nudpiedo
Please add 2012 in the title. Also this was previously submitted without
comments.

The topic was old... but I am glad someone commented on the downsides of
implementing your own language/tooling and what happens next to the team; for
example:

> Also, it took over a year to develop the compiler, during which time the
> other programmers had to make do with missing features, odd quirks, and
> numerous bugs.

That makes me thing only ultra-flexible teams or huge companies fit the bill
into the approach of creating such a technical debt as a compiler can be.

~~~
billpg
I think if something was published in the past ten years, adding the year is
unnecessary. It is still close enough to "now" to be irrelevant.

~~~
crististm
your last word ruined it...

------
simongr3dal
The first link in the article is not correct anymore, I think it's supposed to
point to this one.
[http://www.gamasutra.com/view/feature/131394/postmortem_naug...](http://www.gamasutra.com/view/feature/131394/postmortem_naughty_dogs_jak_and_.php)

------
jefftime
I remember running into GOAL and GOOL a ways back and was fascinated with it.
One thing I never got good info on was how they handled their memory.
Generally game developers frown upon garbage collection, so I'd love to find
out if GOOL/GOAL did anything to target that specifically. I tried reaching
out to one of the developers on his blog about it but never got a response

~~~
white-flame
If I recall correctly, they used manual memory management for many things. But
regardless of specific tooling, you can still do memory pooling in GC
languages just as well as in manual ones.

The Lispiness that they took advantage of was metaprogramming via
s-expressions, an interactive REPL, and dynamic updating of functions during
runtime (which would require some form of GC in function memory footprint, but
wouldn't be a drag on normal gameplay timing).

------
wernsey
Wow, I remember reading that postmortem when it first came out.

I was still in university at the time and at the time I was only marginally
aware that Lisp existed as an alternative to the Java/C++/Pascal we've been
taught.

After reading the postmortem I became very interested in this mysterious Lisp
language that was being used by the experts.

------
relics443
Curious about the Yahoo Store debacle that was mentioned a few times.

~~~
auvi
I am also curious as I thought Yahoo! Store was written in Common Lisp as it
was acquired from Viaweb.

~~~
FractalLP
I think they rewrote in C++ after buying viaweb. I could be wrong though.

~~~
jlg23
Yes, IIRC that is mentioned in PG's blog post: Beating the Averages.

------
pjmlp
Another Lisp based game was Abuse.

[http://abuse.zoy.org](http://abuse.zoy.org)

------
bryanlarsen
A. Using Lisp with a couple of minor convenience macros can be a very good
idea.

Z. Writing an entire language and ecosystem just for a game is insane.

These are not binary choices: there is a very smooth continuum between these
two, and is one of the major advantages of Lisp. Naughty Dog just took too
many steps from A towards Z. Each step probably seemed reasonable at the
time...

~~~
djur
Infocom, Sierra, and LucasArts all built proprietary VMs and it seems to have
worked out very well for them. People are still making new games that run on
Infocom's Z-Machine, and ScummVM has helped keep those LucasArts games running
to the modern day.

Unreal Engine was very successful with a custom scripting language up until
UE4, too. And Naughty Dog hardly seems to have suffered from their decision to
build a Lisp-based system -- apparently they're still using Racket to script
their (wildly successful) games.

Really, it's only quite recently that the off-the-shelf tooling like UE4 or
Unity has gotten sophisticated and powerful enough that people can make
complex games without having to build a little software ecosystem around them.

~~~
dunham
Also:

Neverwinter Nights:
[https://en.wikipedia.org/wiki/NWScript](https://en.wikipedia.org/wiki/NWScript)

Morrowind:
[http://en.uesp.net/morrow/editor/mw_scripting.shtml](http://en.uesp.net/morrow/editor/mw_scripting.shtml)

And I suspect countless others. (These two games exposed their developer tools
to the customers so they could extend the game.)

