Game Oriented Assembly Lisp
Encyclopedia
Game Oriented Assembly Lisp (or GOAL) is a computer game programming language developed by Andy Gavin
and the Jak and Daxter
team at Naughty Dog
. It was written using Allegro Common Lisp
and used in the development of the entire Jak and Daxter
series of games.
Syntactically GOAL resembles Scheme, though with many idiosyncratic features such as classes, inheritance, and virtual functions. GOAL encourages an imperative programming
style: programs tend to consist of a sequence of events to be executed rather than the functional programming
style of functions to be evaluated recursively. This is a diversion from Scheme, which allows such side-effects but does not encourage imperative style.
GOAL does not run in an interpreter, but instead is compiled directly into PlayStation 2
machine code for execution. It offers limited facilities for garbage collection
, relying extensively on runtime support. It offers dynamic memory allocation primitives designed to make it well-suited to running in constant memory on a video game console. GOAL has extensive support for inlined
assembly code using a special
The GOAL compiler is implemented in Allegro Common Lisp
. It supports a long term compiling listener session which gives the compiler knowledge about the state of the compiled and therefore running program, including the symbol table. This, in addition to dynamic linking, allows a function to be edited, recompiled, uploaded, and inserted into a running game without having to restart. The process is similar to the "edit and continue" feature offered by some C++
compilers, but allows the programmer to replace arbitrary amounts of code (even up to entire object files), and does not interrupt the running game with the debugger. This feature was used to implement code as well as level streaming in the Jak and Daxter
games.
GOAL's first use was for the original Jak and Daxter
PS2 game; the predecessor language, GOOL, was also developed by Andy Gavin for Crash Bandicoot.
GOAL's primary development and maintenance engineer is no longer available to Naughty Dog, and they have transitioned to C++ for future projects.
Andy Gavin
Andy Gavin is a programmer notable for co-founding the video game company Naughty Dog with childhood friend Jason Rubin in 1986. Naughty Dog's games are known for their combination of exceptional technology, great graphics, and polished gameplay...
and the Jak and Daxter
Jak and Daxter
Jak and Daxter is a critically acclaimed video game franchise created by Naughty Dog for the PlayStation 2.The series consists of four main games and two spin-offs,though they are also considered to be part of the main series...
team at Naughty Dog
Naughty Dog
Naughty Dog, Inc. is an American video game developer based in Santa Monica, California. Founded by Andy Gavin and Jason Rubin in 1986 as an independent developer, the studio was acquired by Sony Computer Entertainment in 2001...
. It was written using Allegro Common Lisp
Allegro Common Lisp
Allegro Common Lisp is a commercial implementation of the Common Lisp programming language developed by Franz Inc. Allegro CL provides the full ANSI Common Lisp standard with many extensions...
and used in the development of the entire Jak and Daxter
Jak and Daxter
Jak and Daxter is a critically acclaimed video game franchise created by Naughty Dog for the PlayStation 2.The series consists of four main games and two spin-offs,though they are also considered to be part of the main series...
series of games.
Syntactically GOAL resembles Scheme, though with many idiosyncratic features such as classes, inheritance, and virtual functions. GOAL encourages an imperative programming
Imperative programming
In computer science, imperative programming is a programming paradigm that describes computation in terms of statements that change a program state...
style: programs tend to consist of a sequence of events to be executed rather than the functional programming
Functional programming
In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state...
style of functions to be evaluated recursively. This is a diversion from Scheme, which allows such side-effects but does not encourage imperative style.
GOAL does not run in an interpreter, but instead is compiled directly into PlayStation 2
PlayStation 2
The PlayStation 2 is a sixth-generation video game console manufactured by Sony as part of the PlayStation series. Its development was announced in March 1999 and it was first released on March 4, 2000, in Japan...
machine code for execution. It offers limited facilities for garbage collection
Garbage collection (computer science)
In computer science, garbage collection is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program...
, relying extensively on runtime support. It offers dynamic memory allocation primitives designed to make it well-suited to running in constant memory on a video game console. GOAL has extensive support for inlined
Inline expansion
In computing, inline expansion, or inlining, is a manual or compiler optimization that replaces a function call site with the body of the callee. This optimization may improve time and space usage at runtime, at the possible cost of increasing the final size of the program In computing, inline...
assembly code using a special
rlet
form , allowing programmers to freely mix assembly and higher-level constructs within the same function.The GOAL compiler is implemented in Allegro Common Lisp
Allegro Common Lisp
Allegro Common Lisp is a commercial implementation of the Common Lisp programming language developed by Franz Inc. Allegro CL provides the full ANSI Common Lisp standard with many extensions...
. It supports a long term compiling listener session which gives the compiler knowledge about the state of the compiled and therefore running program, including the symbol table. This, in addition to dynamic linking, allows a function to be edited, recompiled, uploaded, and inserted into a running game without having to restart. The process is similar to the "edit and continue" feature offered by some C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
compilers, but allows the programmer to replace arbitrary amounts of code (even up to entire object files), and does not interrupt the running game with the debugger. This feature was used to implement code as well as level streaming in the Jak and Daxter
Jak and Daxter
Jak and Daxter is a critically acclaimed video game franchise created by Naughty Dog for the PlayStation 2.The series consists of four main games and two spin-offs,though they are also considered to be part of the main series...
games.
GOAL's first use was for the original Jak and Daxter
Jak and Daxter
Jak and Daxter is a critically acclaimed video game franchise created by Naughty Dog for the PlayStation 2.The series consists of four main games and two spin-offs,though they are also considered to be part of the main series...
PS2 game; the predecessor language, GOOL, was also developed by Andy Gavin for Crash Bandicoot.
GOAL's primary development and maintenance engineer is no longer available to Naughty Dog, and they have transitioned to C++ for future projects.
External links
- http://www.franz.com/success/customer_apps/animation_graphics/naughtydog.lhtml — Franz Inc. success story
- http://bc.tech.coop/blog/060118.html — Page about Lisp developments by Paul Graham and Naughty DogNaughty DogNaughty Dog, Inc. is an American video game developer based in Santa Monica, California. Founded by Andy Gavin and Jason Rubin in 1986 as an independent developer, the studio was acquired by Sony Computer Entertainment in 2001...
- http://www.gamasutra.com/gdcarchive/2003/White_Stephen.ppt — (Powerpoint) Jak & Daxter: The Precursor Legacy, development overview, lessons learned, very interesting
- http://www.gamasutra.com/gdcarchive/2003/Denman_Stu.ppt — (Powerpoint) Highly detailed continuous worlds, about the streaming world loader