Pawn
A small, fast, typeless embedded scripting language with a C-like syntax, created by Thiadmer Riemersma at ITB CompuPhase and widely used to script games and embedded devices.
Created by Thiadmer Riemersma (ITB CompuPhase)
Pawn is a small, fast, typeless scripting language with a C-like syntax, created by Thiadmer Riemersma at the Dutch company ITB CompuPhase. It is not a stand-alone application language but an embedded or extension language: programs written in Pawn are compiled to compact bytecode (P-code) that runs on a small abstract machine hosted inside another application or device. That design — quick to learn, cheap to run, and easy to sandbox — has made Pawn especially popular for scripting games, and it underpins large modding communities such as San Andreas Multiplayer and the AlliedModders ecosystem.
History & Origins
Pawn began life in 1998 under a different name: Small. Riemersma built it on top of the Small C compiler written by Ron Cain and James E. Hendrix (whose work was popularized through Dr. Dobb’s publications), trimming and reshaping it into a tiny scripting language suitable for embedding. The language was written up in Dr. Dobb’s Journal in October 1999, which helped introduce it to a wider audience of C and embedded-systems programmers.
For several years the language was developed and refined under the “Small” name. On 18 March 2005, with release 3, it was renamed to Pawn. The rationale was partly practical: searching the web for a scripting language literally called “small” was frustratingly difficult, and a distinctive name like “Pawn” made the language and its community far easier to find.
The Pawn toolkit — compiler, abstract machine, and documentation — has long been the work of ITB CompuPhase, with notable early contributions from Marc Peter, who is credited with a just-in-time compiler for x86 and related assembler optimizations of the abstract machine in the late 1990s and early 2000s. The software is distributed under the Apache License 2.0 (with an exception clause permitting static linking into commercial applications), and its source is mirrored on GitHub and Codeberg.
A note on dates. Pawn is frequently associated with the year 2006 because that is when San Andreas Multiplayer brought it to a mass audience. The language itself, however, first appeared in 1998 as “Small” and was renamed to “Pawn” in 2005. This page uses 1998 as the first-appearance year and treats SA-MP as a notable use rather than the language’s origin.
Design Philosophy
Pawn is deliberately minimal. Its goal is run-time efficiency, stability, simplicity, and a small, deterministic memory footprint — the kind of properties that matter when a language has to run inside a game server loop or on a microcontroller. To get there, Pawn omits much of the machinery found in general-purpose languages:
- Typeless by default. Every value is a 32-bit cell. There are no separate integer, float, pointer, struct, or class types at the language core; floating-point and string handling are layered on top of the cell model through library conventions.
- No pointers, no manual allocation. Pawn intentionally leaves out pointers, dynamic memory allocation, and the bookkeeping that comes with them, which removes whole categories of bugs and keeps scripts easy to sandbox.
- Optional “tags” for safety. While typeless, Pawn supports a lightweight tag mechanism that lets the programmer mark values (for example as
Float:orbool:) so the compiler can issue warnings on mismatched use — opt-in, weak type checking rather than a full type system. - Embed, don’t replace. Pawn is designed to script the functionality an application or device already provides, somewhat like Visual Basic for Applications but considerably smaller and, according to its authors, faster. The host program exposes “native” functions that Pawn scripts call.
Key Features
- C-like syntax with familiar braces, semicolons, and control flow, lowering the barrier for anyone who knows C, C++, or similar languages.
- Compiles to P-code (bytecode) that runs on the Abstract Machine (AMX), a small virtual machine that can be embedded in a host program.
- Tiny footprint: the abstract machine is designed to run in very constrained environments — in some configurations with only a few kilobytes of RAM — making Pawn viable on embedded hardware.
- Native functions let the host application expose its own capabilities to scripts, which is how game servers add commands, events, and APIs.
- States and automatons: Pawn includes built-in support for state machines, where functions can be tied to a particular state — a feature aimed at event-driven and embedded control code.
- Unicode support (UTF-8 and UCS-4) for text handling.
- Performance tooling: optimized assembler interpreter cores for several instruction sets, plus a JIT compiler for x86.
A flavour of the syntax
#include <console>
main()
{
new name[] = "World";
printf "Hello, %s!\n", name;
}
The C heritage is obvious, but the typeless new declaration (rather than a typed one) and the script-oriented entry point are characteristic of Pawn.
Evolution
Although Pawn is intentionally stable, it has continued to evolve:
| Milestone | Approx. date |
|---|---|
| First release as “Small” | 1998 |
| Described in Dr. Dobb’s Journal | October 1999 |
| Renamed “Small” → “Pawn” (release 3) | March 2005 |
| Pawn 4.x instruction-set reorganization | mid/late 2000s onward |
| Pawn 4.1 (build 7487) | 2025 |
Over time the toolkit gained a reorganized instruction set with multiple capability tiers, broader processor support (including ARM assembler cores), and refinements to debugging, the IDE tooling, and the abstract machine. The most actively used dialects in the wild are sometimes community forks — for example, the SA-MP / open.mp community maintains its own compiler lineage, and AlliedModders’ SourcePawn diverged from Pawn around 2006–2007 and added static typing for the Source-engine modding world.
Current Relevance
Pawn’s mainstream visibility comes almost entirely from gaming. In the GTA: San Andreas multiplayer world, SA-MP and now its open-source successor open.mp rely on Pawn for game-mode scripting, and a very large body of community code and tutorials exists in the language. In the Half-Life / Source modding world, AMX Mod X (Pawn) and SourceMod (SourcePawn) remain widely deployed on competitive game servers. Beyond games, Pawn’s small, deterministic runtime keeps it relevant as an embeddable extension language for applications and devices.
CompuPhase still maintains the reference toolkit — recent 4.1 builds were released in 2025 — so Pawn is an actively supported language rather than a historical curiosity, even if its day-to-day use is concentrated in specific communities.
Why It Matters
Pawn is a clear example of how a small, focused language can earn an outsized footprint by being easy to embed and easy to learn. By stripping away pointers, manual memory management, and a heavy type system, it became approachable enough that thousands of hobbyist modders — many writing their first code — could build entire multiplayer game modes in it. At the same time, its compact abstract machine made it a credible scripting engine for resource-constrained software. Through direct use in SA-MP and open.mp, and through its descendant SourcePawn, Pawn has quietly shaped how a generation of game-server scripting works.
Timeline
Notable Uses & Legacy
San Andreas Multiplayer (SA-MP)
SA-MP, the popular unofficial multiplayer mod for GTA: San Andreas, uses Pawn for writing server game modes and filterscripts, making it the language many in the modding community first learned.
open.mp (Open Multiplayer)
The open-source, SA-MP-compatible successor open.mp retains Pawn as its scripting language, pairing it with a new compiler and expanded server/client functions.
AMX Mod X
AMX Mod X, a Metamod plugin for GoldSrc (Half-Life 1) servers used heavily with Counter-Strike 1.6, lets administrators write server plugins in Pawn, compiled to AMX bytecode.
SourcePawn / SourceMod
SourcePawn, a statically typed language derived from Pawn, powers SourceMod plugins for Valve's Source engine games such as Counter-Strike: Source, Team Fortress 2, and Left 4 Dead.
Embedded systems and devices
Because the Pawn abstract machine is small and deterministic and can run with only a few kilobytes of RAM, Pawn is used as an embeddable extension language inside applications, firmware, and microcontroller projects.