Game Oriented Assembly Lisp (GOAL, also known as Game Object Assembly Lisp) is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
, a
dialect
A dialect is a Variety (linguistics), variety of language spoken by a particular group of people. This may include dominant and standard language, standardized varieties as well as Vernacular language, vernacular, unwritten, or non-standardize ...
of the language
Lisp
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation.
Originally specified in the late 1950s, ...
, made for
video game
A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
s developed by
Andy Gavin and the ''
Jak and Daxter
''Jak and Daxter'' is a platform video game franchise created by Andy Gavin and Jason Rubin and owned by Sony Interactive Entertainment. The series was originally developed by Naughty Dog with a number of installments being outsourced to Re ...
'' team at the company
Naughty Dog
Naughty Dog, LLC (formerly JAM Software, Inc.) is an American first-party video game developer based in Santa Monica, California. Founded by Andy Gavin and Jason Rubin in 1984, the studio was acquired by Sony Computer Entertainment in 2001. G ...
.
It was written using
Allegro Common Lisp
Allegro Common Lisp is a programming language with an integrated development environment (IDE), developed by Franz Inc. It is a dialect of the language Lisp, a commercial software implementation of the language Common Lisp. Allegro CL provides t ...
and used in the development of the entire ''Jak and Daxter'' series of games (excluding ''
Daxter
This is a list of characters in the ''Jak and Daxter'' series, a video game franchise originally developed by Naughty Dog for the PlayStation 2. Currently, six games in the series have been released, with Jak as the primary playable character in ...
'' and ''
Jak and Daxter: The Lost Frontier'').
Design
GOAL's
syntax
In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
resembles the Lisp dialect
Scheme, though with many idiosyncratic
object-oriented programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
features such as
class
Class, Classes, or The Class may refer to:
Common uses not otherwise categorized
* Class (biology), a taxonomic rank
* Class (knowledge representation), a collection of individuals or objects
* Class (philosophy), an analytical concept used d ...
es,
inheritance
Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offi ...
, and
virtual function
In object-oriented programming such as is often used in C++ and Object Pascal, a virtual function or virtual method is an inheritable and overridable function or method that is dispatched dynamically. Virtual functions are an important part ...
s.
GOAL encourages an
imperative programming
In computer science, imperative programming is a programming paradigm of software that uses Statement (computer science), statements that change a program's state (computer science), state. In much the same way that the imperative mood in natural ...
style: programs tend to consist of a sequence of events to be executed rather than the
functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarat ...
style of
functions to be evaluated recursively. This is a diversion from Scheme, which allows such
side effect
In medicine, a side effect is an effect of the use of a medicinal drug or other treatment, usually adverse but sometimes beneficial, that is unintended. Herbal and traditional medicines also have side effects.
A drug or procedure usually use ...
s but does not encourage imperative style.
GOAL does not run in an
interpreter
Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
, but instead is
compiled directly into
PlayStation 2
The PlayStation 2 (PS2) is a home video game console developed and marketed by Sony Interactive Entertainment, Sony Computer Entertainment. It was first released in Japan on 4 March 2000, in North America on 26 October, in Europe on 24 Novembe ...
machine code to execute. It offers limited facilities for
garbage collection
Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclable ...
, relying extensively on
runtime support. It offers dynamic memory allocation primitives designed to make it well-suited to running in constant
memory
Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
on a video game console. GOAL has extensive support for
inlined assembly language
In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
code using a special
rlet
form,
allowing programs to freely mix assembly and higher-level constructs within one function.
The GOAL compiler is implemented in
Allegro Common Lisp
Allegro Common Lisp is a programming language with an integrated development environment (IDE), developed by Franz Inc. It is a dialect of the language Lisp, a commercial software implementation of the language Common Lisp. Allegro CL provides t ...
. It supports a long term compiling listener session which gives the compiler knowledge about the state of the compiled and thus 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 programs 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 and to enable level streaming in the ''
Jak and Daxter
''Jak and Daxter'' is a platform video game franchise created by Andy Gavin and Jason Rubin and owned by Sony Interactive Entertainment. The series was originally developed by Naughty Dog with a number of installments being outsourced to Re ...
'' games.
Uses
GOAL's first use was for the game ''
Jak and Daxter: The Precursor Legacy''. The predecessor language, Game Oriented Object Lisp (GOOL), was also developed by Andy Gavin for ''
Crash Bandicoot
''Crash Bandicoot'' is a video game franchise originally developed by Naughty Dog as an exclusive for Sony's PlayStation console. It has seen numerous installments created by various developers and published on multiple platforms. The series c ...
''.
Since Naughty Dog no longer employs GOAL's primary development and maintenance engineer, and they were under pressure from their new
parent company
A holding company is a company whose primary business is holding a controlling interest in the Security (finance), securities of other companies. A holding company usually does not produce goods or services itself. Its purpose is to own Share ...
,
Sony
is a Japanese multinational conglomerate (company), conglomerate headquartered at Sony City in Minato, Tokyo, Japan. The Sony Group encompasses various businesses, including Sony Corporation (electronics), Sony Semiconductor Solutions (i ...
, to share technology between studios, Naughty Dog transitioned away from Lisp:
However, they have since resumed using it for scripting on some
PlayStation 3
The PlayStation 3 (PS3) is a home video game console developed and marketed by Sony Computer Entertainment (SCE). It is the successor to the PlayStation 2, and both are part of the PlayStation brand of consoles. The PS3 was first released on ...
games, including ''
The Last of Us
''The Last of Us'' is a 2013 action-adventure game developed by Naughty Dog and published by Sony Computer Entertainment. Players control Joel, a smuggler tasked with escorting a teenage girl, Ellie, across a post-apocalyptic United States ...
''.
OpenGOAL
A community project, OpenGOAL, started in 2020 with the goal of porting GOAL to
x86-64
x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
by decompiling existing ''
Jak and Daxter: The Precursor Legacy'', ''
Jak II
''Jak II'' is an action-adventure video game developed by Naughty Dog and published by Sony Computer Entertainment for the PlayStation 2 in 2003. It is the second game of the ''Jak and Daxter'' series and a sequel to '' Jak and Daxter: The Prec ...
'', ''
Jak 3
''Jak 3'' is a 2004 action-adventure video game developed by Naughty Dog and published by Sony Computer Entertainment for the PlayStation 2. The game is the sequel to '' Jak II'' and serves as the conclusion of the trilogy. The story of the prev ...
'' and, tentatively, ''
Jak X: Combat Racing'' assets and recompiling them natively.
It includes a GOAL compiler written in C++ as well as a
read–eval–print loop
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written ...
to enable a similar workflow to Naughty Dog's original implementation. By November 2023, the OpenGOAL team had produced Windows and Linux ports for the first two games that are 100% completable, with a ''
Jak 3
''Jak 3'' is a 2004 action-adventure video game developed by Naughty Dog and published by Sony Computer Entertainment for the PlayStation 2. The game is the sequel to '' Jak II'' and serves as the conclusion of the trilogy. The story of the prev ...
'' port in development .
References
External links
Naughty Dog Software: Raising the Paradigm of Video Gaming – Again…Thanks to Lisp and Allegro CLJak & Daxter: The Precursor Legacy(PowerPoint) – development overview, lessons learned
Highly Detailed Continuous Worlds – about the streaming world loader
{{Lisp programming language
Lisp programming language family
Functional languages
Object-oriented programming languages
Common Lisp (programming language) software
Video game development
Domain-specific programming languages